KFold.__init__() got an unexpected keyword argument 'n_folds'
时间: 2023-07-28 10:06:44 浏览: 213
Error Encountered an improper argument
The error message suggests that the `KFold` class does not have a parameter named `n_folds`.
Instead, `KFold` has a parameter named `n_splits`, which specifies the number of folds to create. Try changing `n_folds` to `n_splits` in your code and see if that resolves the issue.
For example:
```
from sklearn.model_selection import KFold
# Create a KFold object with 5 splits/folds
kf = KFold(n_splits=5, shuffle=True)
```
阅读全文