成功解决lightgbm.basic.LightGBMError: Parameter max_depth should be of type int, got “0.02“

简介: 成功解决lightgbm.basic.LightGBMError: Parameter max_depth should be of type int, got “0.02“


目录

解决问题

解决思路

解决方法


解决问题

raise LightGBMError(decode_string(_LIB.LGBM_GetLastError()))

lightgbm.basic.LightGBMError: Parameter max_depth should be of type int, got "0.02"

解决思路

raise LightGBM 解码字符串出错!

lightgbm.basic.lightgbm错误:参数max_depth 应为int类型,但是却获得“0.02”

解决方法

将参数进行修改

1. learning_rat = params3[1]
2. max_dept = params3[0]
3. n_estimato = params3[2]

改为

1. learning_rat = params3[0]
2. max_dept = params3[1]
3. n_estimato = params3[2]


相关文章
|
19天前
|
Python
[oeasy]python036_数据类型有什么用_type_类型_int_str_查看帮助
本文回顾了Python中`ord()`和`chr()`函数的使用方法,强调了这两个函数互为逆运算:`ord()`通过字符找到对应的序号,`chr()`则通过序号找到对应的字符。文章详细解释了函数参数类型的重要性,即`ord()`需要字符串类型参数,而`chr()`需要整数类型参数。若参数类型错误,则会引发`TypeError`。此外,还介绍了如何使用`type()`函数查询参数类型,并通过示例展示了如何正确使用`ord()`和`chr()`进行转换。最后,强调了在函数调用时正确传递参数类型的重要性。
19 3
|
11天前
|
TensorFlow 算法框架/工具
Tensorflow error(二):x and y must have the same dtype, got tf.float32 != tf.int32
本文讨论了TensorFlow中的一个常见错误,即在计算过程中,变量的数据类型(dtype)不一致导致的错误,并通过使用`tf.cast`函数来解决这个问题。
13 0
|
2月前
|
Dart JavaScript 前端开发
Dart或Flutter中解决异常-type ‘int‘ is not a subtype of type ‘double‘
Dart或Flutter中解决异常-type ‘int‘ is not a subtype of type ‘double‘
105 4
|
3月前
|
存储 Python
语音输入,python数据类型,type()用来查看数据类型,数据类型转换,int(x)转整数,float(x)转换为浮点数,str(x),将对象转为字符串,标识符,标识符不允许使用关键字,关键字参考
语音输入,python数据类型,type()用来查看数据类型,数据类型转换,int(x)转整数,float(x)转换为浮点数,str(x),将对象转为字符串,标识符,标识符不允许使用关键字,关键字参考
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
672 0
TypeError: randint() received an invalid combination of arguments - got (int, int, int), but expecte
TypeError: randint() received an invalid combination of arguments - got (int, int, int), but expecte
667 0
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
460 0
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘
成功解决ret = ret / rcountTypeError: unsupported operand type(s) for /: ‘str‘ and ‘int‘
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
240 0