其实是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