feat(lab-4): make pipeline
This commit is contained in:
parent
bd8c7a6d2b
commit
5ab313468c
1074
notebooks/lab4.ipynb
Normal file
1074
notebooks/lab4.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
17
notebooks/transformers.py
Normal file
17
notebooks/transformers.py
Normal file
@ -0,0 +1,17 @@
|
||||
import numpy as np
|
||||
from sklearn.base import BaseEstimator, TransformerMixin
|
||||
|
||||
|
||||
class CarsFeatures(BaseEstimator, TransformerMixin):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def fit(self, X, y=None):
|
||||
return self
|
||||
|
||||
def transform(self, X, y=None):
|
||||
X["Age"] = 2020 - X["Prod. year"]
|
||||
return X
|
||||
|
||||
def get_feature_names_out(self, features_in):
|
||||
return np.append(features_in, ["Age"], axis=0)
|
Loading…
x
Reference in New Issue
Block a user