Forked from rodrigofp-cit/black_friday_challenge_pipeline.py
Created
June 30, 2023 17:56
-
-
Save Sandy4321/6497e71da3962b9d6007614bccc3f29a to your computer and use it in GitHub Desktop.
black_friday_challenge_pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.ensemble import RandomForestRegressor | |
from train.models.custom_transformers import BlackFridayPreprocess, BlackFridayIdTransformer, BlackFridayLabelEncoder | |
from sklearn.pipeline import Pipeline | |
def random_forest(): | |
pipeline = Pipeline( | |
[ | |
('preprocess', BlackFridayPreprocess()), | |
('id_filter', BlackFridayIdTransformer( | |
min_freq={'Product_ID': 200, 'User_ID': 100})), | |
('label_encoder', BlackFridayLabelEncoder()), | |
('regressor', RandomForestRegressor(n_estimators=50, max_depth=15)) | |
] | |
) | |
return pipeline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment