微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

imblearn.pipeline中如何使用数据预处理

如何解决imblearn.pipeline中如何使用数据预处理

如何在以下 imblearn.pipeline 中加入缺失值插补和数据缩放?

from imblearn.pipeline import make_pipeline as make_imb_pipeline
from sklearn.linear_model import LogisticRegressionCV
from sklearn.ensemble import RandomForestClassifier
undersample_pipe = make_imb_pipeline(RandomUnderSampler(),LogisticRegressionCV())
scores = cross_validate(undersample_pipe,X,y,cv=5,scoring=('roc_auc','average_precision','f1','recall','balanced_accuracy'))
scores['test_roc_auc'].mean(),scores['test_average_precision'].mean(),scores['test_f1'].mean(),scores['test_recall'].mean(),scores['test_balanced_accuracy'].mean()

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。