Created
November 17, 2020 02:48
-
-
Save tiaplagata/7fef4273e4f515c630d8092cdb0f3198 to your computer and use it in GitHub Desktop.
Using Smote in a 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 imblearn.pipeline import Pipeline | |
from imblearn.over_sampling import SMOTE | |
from sklearn.ensemble import GradientBoostingClassifier | |
pipeline = Pipeline(steps= [ | |
("SMOTE", SMOTE()), | |
("GradientBooster", GradientBoostingClassifier()) | |
]) | |
pipeline.fit(X_train, y_train) | |
y_test_preds = pipeline.predict(X_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment