How can I include SimpleImputer(strategy='constant',fill_value= 0))
, and ("scale", MaxAbsScaler())
in the following imblearn.pipeline
pipeline ? I don't see any option to include data pre-processing steps within the imblearn.pipeline
pipeline framework. Thank you so much for your suggestions!
smote_pipe = make_imb_pipeline(SMOTE(), LogisticRegression())
scores = cross_validate(smote_pipe, X_train, y_train, cv=10,
scoring=('roc_auc', 'average_precision'))
pd.DataFrame(scores)[['test_roc_auc', 'test_average_precision']].mean()
They might not have been mentioned in the documentation, but you can include them.
Here's a fairly minimal reproducible example:
Output (roughly, there's some randomness):