成功解决TypeError: __init__() got an unexpected keyword argument 'n_iterations'

简介: 成功解决TypeError: __init__() got an unexpected keyword argument 'n_iterations'

解决问题


TypeError: __init__() got an unexpected keyword argument 'n_iterations'




解决思路


类型错误:得到意外的关键字参数“n_iterations”




解决方法


先尝试把多余的参数去掉,如果不行就升级函数包即可!


cv=StratifiedShuffleSplit(Y_train, n_iter=10, test_size=0.2, train_size=None, indices=None, \

                                                    random_state=seed, n_iterations=None)).fit(X_train, Y_train)

改为

cv=StratifiedShuffleSplit(Y_train, n_iter=10, test_size=0.2, train_size=None, indices=None, \

                                                    random_state=seed)).fit(X_train, Y_train)

大功告成!哈哈!


相关文章
|
5月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
824 0
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
5月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
241 0
|
5月前
|
Python
【Python】已解决:TypeError: write._Log() takes 0 positional arguments but 1 was given
【Python】已解决:TypeError: write._Log() takes 0 positional arguments but 1 was given
199 0
|
算法框架/工具
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
203 0
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
TypeError: custom() got an unexpected keyword argument ‘path‘
TypeError: custom() got an unexpected keyword argument ‘path‘
164 0
|
机器学习/深度学习 Windows
raise RuntimeError(‘Error(s) in loading state_dict for {}:\n\t{}‘.format( RuntimeError: Error(s)..报错
即load_state_dict(fsd,strict=False) 属性strict;当strict=True,要求预训练练权重层数的键值与新构建的模型中的权重层数名称完全吻合;
1576 0
|
Dart 前端开发 JavaScript
Syntax Error: TypeError: this.getOptions is not a function
Syntax Error: TypeError: this.getOptions is not a function
546 0
Syntax Error: TypeError: this.getOptions is not a function
解决TypeError: __init__() takes from 1 to 3 positional arguments but 6 were given
解决TypeError: __init__() takes from 1 to 3 positional arguments but 6 were given
468 0
解决TypeError: __init__() takes from 1 to 3 positional arguments but 6 were given

热门文章

最新文章