train_test_split() got an unexpected keyword argument 'Shuffle'
时间: 2023-07-28 12:15:45 浏览: 125
The error message suggests that the `train_test_split()` function is receiving an unexpected keyword argument `Shuffle`. This could happen if you misspelled the argument name or if the argument is not supported by the version of the function you are using.
In scikit-learn's `train_test_split()` function, the argument for shuffling the data is `shuffle` (lowercase "s") and it is a boolean value. Therefore, you should change `Shuffle` to `shuffle` in your code.
Here is an example of how to use `train_test_split()` with shuffling:
```python
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, shuffle=True)
```
Make sure that you have the latest version of scikit-learn installed to avoid any potential compatibility issues.
阅读全文