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.
More Related Contents:
- How are feature_importances in RandomForestClassifier determined?
- What does `sample_weight` do to the way a `DecisionTreeClassifier` works in sklearn?
- difference between arrays in numpy
- value error in python script
- How to split data into 3 sets (train, validation and test)?
- Label encoding across multiple columns in scikit-learn
- what is the difference between ‘transform’ and ‘fit_transform’ in sklearn
- scikit-learn DBSCAN memory usage
- Preprocessing in scikit learn – single sample – Depreciation warning
- How to interpret MSE in Keras Regressor
- How to convert a Scikit-learn dataset to a Pandas dataset
- UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples
- Keep same dummy variable in training and testing data
- scikit-learn GridSearchCV with multiple repetitions
- Feature/Variable importance after a PCA analysis
- Using hyphen/dash in python repository name and package name
- Cross-validation metrics in scikit-learn for each data split
- Why does one hot encoding improve machine learning performance? [closed]
- difference between StratifiedKFold and StratifiedShuffleSplit in sklearn
- Scikit-learn: How to obtain True Positive, True Negative, False Positive and False Negative
- ValueError: n_splits=10 cannot be greater than the number of members in each class
- TfidfVectorizer in scikit-learn : ValueError: np.nan is an invalid document
- How to use sklearn fit_transform with pandas and return dataframe instead of numpy array?
- Tensorflow Precision / Recall / F1 score and Confusion matrix
- Got continuous is not supported error in RandomForestRegressor
- confused about random_state in decision tree of scikit learn
- Can I send callbacks to a KerasClassifier?
- How to get most informative features for scikit-learn classifier for different class?
- scikit-learn .predict() default threshold
- ImportError: No module named sklearn.cross_validation