成功解决ValueError: Supported target types are:('binary', 'multiclass'). Got 'continuous' instead.
作者:一个处女座的程序猿 时间:2023-01-24 03:59:00
成功解决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)
哈哈,大功告成!
来源:https://blog.csdn.net/qq_41185868/article/details/129273048
标签:Supported,target,types,are
0
投稿
猜你喜欢
使用Java实现先查询缓存再查询数据库
2024-01-14 02:18:05
IDEA怎么切换Git分支的实现方法
2022-10-11 14:20:21
python完成FizzBuzzWhizz问题(拉勾网面试题)示例
2022-01-31 14:41:11
利用css的clear属性搞定广告文字环绕效果
2008-05-24 13:48:00
mysql中索引使用不当速度比没加索引还慢的测试
2024-01-13 13:17:44
纯JS实现本地图片预览的方法
2024-05-03 15:04:32
jquery AJAX 三个发送状态 posting, error, success
2010-07-31 18:59:00
基于ASPJPEG 制作了一个梦寐已久的批量水印工具步骤
2011-02-28 10:39:00
PHP 中文简繁互转代码 完美支持大陆、香港、台湾及新加坡
2023-11-15 11:46:16
Matlab中关于argmax、argmin函数的使用解读
2023-06-27 20:36:53
python实现简单的名片管理系统
2022-12-28 21:19:05
Python模拟脉冲星伪信号频率实例代码
2023-02-12 06:01:08
详解python的变量
2021-01-26 20:44:20
网站重构 CSS样式表的优化技巧
2009-05-12 11:51:00
设定php简写功能的方法
2024-05-13 09:25:21
asp按关键字查询XML的代码
2011-04-21 11:10:00
举例详解Go语言中os库的常用函数用法
2024-05-08 10:43:53
tensorflow 实现数据类型转换
2023-09-20 11:35:47
斜角滑动门导航条 DIV+CSS
2008-07-19 15:45:00
条件CSS的介绍
2009-03-13 13:57:00