feat(lab-4): make pipeline

This commit is contained in:
Zakharov_Rostislav 2024-12-07 13:00:14 +04:00
parent bd8c7a6d2b
commit 5ab313468c
2 changed files with 1091 additions and 0 deletions

1074
notebooks/lab4.ipynb Normal file

File diff suppressed because it is too large Load Diff

17
notebooks/transformers.py Normal file
View 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)