It looks like sklearn requires the data shape of (row number, column number). If your data shape is (row number, ) like (999, )
, it does not work. By using numpy.reshape()
, you should change the shape of the array to (999, 1)
, e.g. using
data=data.reshape((999,1))
In my case, it worked with that.
Related Posts:
- XGBoost XGBClassifier Defaults in Python
- how to resolve this ValueError: only 2 non-keyword arguments accepted sklearn python
- Is there a library function for Root mean square error (RMSE) in python?
- ImportError: No module named sklearn.cross_validation
- ImportError: No module named sklearn.cross_validation
- No module named ‘sklearn.cross_validation’
- LogisticRegression: Unknown label type: ‘continuous’ using sklearn in python
- ValueError: Unknown label type: ‘continuous’
- Converting list to numpy array
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- TypeError: cannot perform reduce with flexible type
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- How to normalize a NumPy array to a unit vector?
- ModuleNotFoundError: No module named ‘sklearn’
- Arrays used as indices must be of integer (or boolean) type
- How can I plot a confusion matrix? [duplicate]
- ModuleNotFoundError: No module named ‘sklearn’
- ImportError: No module named sklearn (Python)
- How to normalize a NumPy array to a unit vector?
- Arrays used as indices must be of integer (or boolean) type
- Parameter “stratify” from method “train_test_split” (scikit Learn)
- sklearn Logistic Regression “ValueError: Found array with dim 3. Estimator expected <= 2."
- RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility
- Difference between scikit-learn and sklearn
- Get Confusion Matrix From a Keras Multiclass Model
- What’s the difference between scikit-learn and tensorflow? Is it possible to use them together?
- Cross Validation in Keras
- Scikit-learn GridSearch giving “ValueError: multiclass format is not supported” error
- ImportError in importing from sklearn: cannot import name check_build
- Can sklearn random forest directly handle categorical features?
- ImportError: No module named model_selection
- how to check which version of nltk, scikit learn installed?
- Got continuous is not supported error in RandomForestRegressor
- Python/Scikit-Learn – Can’t handle mix of multiclass and continuous
- TypeError: fit() missing 1 required positional argument: ‘y’
- ValueError: multiclass format is not supported
- Naive Bayes vs. SVM for classifying text data