使用lgb.cv时出现ValueError: Supported target types are: (‘binary’, ‘multiclass’). Got ‘continuous’ instead.

默认情况下,lightgbm.cv中的stratify参数是True。 根据the documentation:

stratified (bool, optional (default=True)) – Whether to perform stratified sampling.

但是stratify只处理分类问题。因此,要处理回归,需要使其为假。

cv_results = lgb.cv(
params,
dftrainLGB,
num_boost_round=100,
nfold=3,
metrics=‘mae’,
early_stopping_rounds=10,

    # This is what I added**stratified=False**)

现在它开始工作了。

使用lgb.cv时出现ValueError: Supported target types are: (‘binary‘, ‘multiclass‘). Got ‘continuous‘ instea相关推荐

  1. 使用stratifiedKFold进行分层交叉验证时候报错:ValueError: Supported target types are: ('binary', 'multiclass'). Got

    ValueError Traceback (most recent call last) <ipython-input-42-2ab744268d80> in <module> ...

  2. 使用pandas时遇到ValueError: numpy.dtype has the wrong size, try recompiling

    [问题]使用pandas时遇到ValueError: numpy.dtype has the wrong size, try recompiling [原因] 这是因为 Python 包的版本问题,例 ...

  3. python readline读文件,并且将其转化为数字形式时:ValueError: could not convert string to float:

    记死这个float 错误描述: 将csv文件中的数据预处理之后,写入txt文本中,再从文本中读取数据进行处理时报错:python readline读文件,并且将其转化为数字形式时:ValueError ...

  4. Pytorch使用DistributedDataParallel单机多卡训练时遇到ValueError: sampler option is mutually exclusive with shuff

    Pytorch使用DistributedDataParallel单机多卡训练时遇到 ValueError: sampler option is mutually exclusive with shuf ...

  5. 无法完成安装:'unsupported configuration: hda-duplex not supported in this QEMU binary'

    Linux 有问必答:如何修复"hda-duplex not supported in this QEMU binary" 编译自:http://ask.xmodulo.com/h ...

  6. 【解决方案】ValueError: Some of types cannot be determined by the first 100 rows

    问题 在 spark 中试图将 RDD 转换成 DataFrame 时,有时会提示 ValueError: Some of types cannot be determined by the firs ...

  7. pyspark ValueError: Some of types cannot be determined after inferring

    场景:当pandas的DF转换成spark的DF的时候报错 ValueError: Some of types cannot be determined after inferring 报错原因是  ...

  8. format python value error_格式化计算变量时出现“ValueError:无效的格式说明符”

    这是我第三次和python一起工作了,因为我在学习Gaddis的教科书,所以我不得不为烘焙饼干制作一个配料调整程序.但是,我尝试格式化数字的最后一行代码ValueError:Invalid forma ...

  9. 《Linux运维总结:安装OpenEuler20.03系统时卡在Reached target Basic System》

    一.背景信息 使用U盘安装OpenEuler20.03操作系统时,卡在了Reached target Basic System. 如下图所示: 二.解决方法 原因分析:由于u盘在刻入镜像时,会重命名u ...

最新文章

  1. linux账号管理命令,linux账号管理及相关命令和操作
  2. 极限编程 (Extreme Programming) 和用户故事 (User Stories) 的关系
  3. Javascript 或运算的判断小问题
  4. 深入理解分布式技术 - 结合RocketMQ和Kafka理解MQ的两种经典模式_P2P模式和发布订阅模式
  5. 通过管道传输快速将MySQL的数据导入Redis(自己做过测试)
  6. Linux之CentOS的PHP为7.2但显示5.4版本
  7. php运行条件,PHP配置环境要求 php运行的先决条件
  8. 《走遍中国》珍藏版(十一)
  9. day30 并发编程
  10. 第二章 数据的表示和运算 2.1.3 字符与字符串 [计算机组成原理笔记]
  11. php获取站点的根目录和站点的根URL
  12. MIT课程全面解读2019深度学习最前沿 | 附视频+PPT
  13. 006 认识BeanNameAware
  14. 类的继承关系声明和访问修饰
  15. atitit..国富论 在现代it企业项目管理中的作用attialx 总结---国富论读后感 attialx
  16. php蓝奏云网盘源码,蓝奏云网盘pc版易语言开源软件源码
  17. 指南针c语言程序,HMC5883L电子指南针单片机程序
  18. IDea更改主题和部分修改主题方法
  19. 局域网内时间同步配置
  20. 【Android开发笔记】4.简单基站定位程序

热门文章

  1. LeetCode:逆波兰式;
  2. 2022年,有哪些小本生意可以做
  3. liunx下查看tomcat占用的端口号
  4. 图像处理1--傅里叶变换(Fourier Transform )
  5. 云服务器和vps二者的区别
  6. 你的能力是更适合做微商还是淘宝
  7. 硬盘挂载-硬盘挂载后为只读模式
  8. python3 文字合成语音MP3
  9. 软件测试工程师简历项目经验怎么写(含真实简历)
  10. 【前端技巧】文本内容单行省略及多行省略