出现 __init__() got an unexpected keyword argument ‘n_folds‘错误

其实是Python旧库与新库的参数冲突,将语句中的n_folds改为n_splits就行了,比如:

kf = model_selection.KFold(titanic.shape[0], n_folds=3, random_state=1)

改为

kf = model_selection.KFold(titanic.shape[0], n_splits=3, random_state=1)

问题解决,错误来自于泰坦尼克号实战:

https://blog.csdn.net/qq_43653405/article/details/107416472

©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页