打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
成功解决ValueError: Supported target types are: (‘binary‘, ‘multiclass‘). Got ‘continuous‘ instead.

成功解决ValueError: Supported target types are: ('binary', 'multiclass'). Got 'continuous' instead.



解决问题

问题背景如下:

SKFold = StratifiedKFold(n_splits=cv_i,shuffle=True,random_state=123)

解决思路

值错误:支持的目标类型为:('binary', 'multiclass'),需要用“continuous”替代。


解决方法

stratify只处理分类任务问题,对于回归任务,采用以下问题解决

from sklearn.model_selection import KFold,StratifiedKFold
n_SKFold = StratifiedKFold(n_splits=cv_i,shuffle=True,random_state=123)

替换为

from sklearn.model_selection import KFold,StratifiedKFold
n_SKFold = KFold(n_splits=n_folds ,shuffle=True,random_state=123)

哈哈,大功告成!

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
药物预测R包之pRRophetic
二十四山立向线法大全
宏--战士宏--通用 老雷
旧电脑比新电脑还好用还流畅的方法
6个完全免费的录音转文字神器,让你事半功倍
潘长宏制作的四款GIF翻页图片
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服