成功解决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)

大功告成!哈哈!


相关文章
|
4月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
583 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
|
4月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
128 0
|
算法框架/工具
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
183 0
TypeError: custom() got an unexpected keyword argument ‘path‘
TypeError: custom() got an unexpected keyword argument ‘path‘
149 0
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
|
机器学习/深度学习 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,要求预训练练权重层数的键值与新构建的模型中的权重层数名称完全吻合;
1541 0
|
Dart 前端开发 JavaScript
Syntax Error: TypeError: this.getOptions is not a function
Syntax Error: TypeError: this.getOptions is not a function
532 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
446 0
解决TypeError: __init__() takes from 1 to 3 positional arguments but 6 were given
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
145 0