scikit-learn expects 2d num arrays for the training dataset for a fit function. The dataset you are passing in is a 3d array you need to reshape the array into a 2d.
nsamples, nx, ny = train_dataset.shape
d2_train_dataset = train_dataset.reshape((nsamples,nx*ny))
More Related Contents:
- How to find the importance of the features for a logistic regression model?
- python kmeans on string
- difference between arrays in numpy
- value error in python script
- Principal Component Analysis (PCA) in Python
- How to get most informative features for scikit-learn classifiers?
- Random state (Pseudo-random number) in Scikit learn
- How can I plot a confusion matrix? [duplicate]
- Why is Random Forest with a single tree much better than a Decision Tree classifier?
- How to one hot encode variant length features?
- Keep same dummy variable in training and testing data
- pandas dataframe columns scaling with sklearn
- How do I calculate a word-word co-occurrence matrix with sklearn?
- Cross-validation metrics in scikit-learn for each data split
- Recovering features names of explained_variance_ratio_ in PCA with sklearn
- Clustering text documents using scikit-learn kmeans in Python
- scikit-learn cross validation, negative values with mean squared error
- ROC for multiclass classification
- What is exactly sklearn.pipeline.Pipeline?
- fit-transform on training data and transform on test data [duplicate]
- Model definition does not give any output
- 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
- scikit-learn random state in splitting dataset
- How to compute precision, recall, accuracy and f1-score for the multiclass case with scikit learn?
- What are the different use cases of joblib versus pickle?
- TypeError: cannot perform reduce with flexible type
- scikit-learn: how to scale back the ‘y’ predicted result
- Using Smote with Gridsearchcv in Scikit-learn
- Python import error: cannot import name ‘six’ from ‘sklearn.externals’