成功解决ValueError: Parameter values for parameter (n_estimators) need to be a sequence.

简介: 成功解决ValueError: Parameter values for parameter (n_estimators) need to be a sequence.

输出结

image.png

 

设计思

值错误:参数(n_estimators)的参数值需要是一个序列。


 

核心代

定位到出错的位置,发现存在 range(1, 51, 1),可知,此函数输出的是 range型数据,而要求需要是序列类型,即list型数据,所以将range类型转为list类型数据即可!


相关文章:成功解决random.py"之TypeError: 'range' object does not support item assignmenthttps://yunyaniu.blog.csdn.net/article/details/82843781



哈哈,大功告成!


相关文章
|
SQL
Parameter ‘id‘ not found. Available parameters are [collection, list]
Parameter ‘id‘ not found. Available parameters are [collection, list]
196 0
|
4月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
95 0
|
10月前
|
数据可视化 数据处理
解决 FAILED: UDFArgumentException explode() takes an array or a map as a parameter 并理解炸裂函数和侧视图
解决 FAILED: UDFArgumentException explode() takes an array or a map as a parameter 并理解炸裂函数和侧视图
68 0
|
JSON 数据格式
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
报错 ValueError: too many values to unpack (expected 2)
报错 ValueError: too many values to unpack (expected 2)
192 0
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
271 0
ValueError: not enough values to unpack (expected 3, got 2)
这个错误通常是因为在解包(unpacking)元组(tuple)时,元组中的元素数量与期望不符,导致无法将所有元素正确解包。 例如,在以下代码中,元组中只有两个元素,但我们尝试将其解包为三个变量:
543 0
params argument given to the optimizer should be an iterable
params argument given to the optimizer should be an iterable
171 0
params argument given to the optimizer should be an iterable
|
Windows
Illegal character in opaque part at index
Illegal character in opaque part at index