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

大功告成!哈哈!


相关文章
|
8月前
|
算法框架/工具
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
Keras报错:TypeError: (‘Keyword argument not understood:‘, ‘offset‘)
122 0
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror Error: Missing required argument #1
661 0
TypeError: custom() got an unexpected keyword argument ‘path‘
TypeError: custom() got an unexpected keyword argument ‘path‘
116 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,要求预训练练权重层数的键值与新构建的模型中的权重层数名称完全吻合;
1293 0
|
Dart 前端开发 JavaScript
Syntax Error: TypeError: this.getOptions is not a function
Syntax Error: TypeError: this.getOptions is not a function
473 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
383 0
解决TypeError: __init__() takes from 1 to 3 positional arguments but 6 were given
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
125 0
TypeError: 'encoding' is an invalid keyword argument for this function
TypeError: 'encoding' is an invalid keyword argument for this function
234 0