I am using a supervised learning algorithm Random Forest classifier for training the data.
clf = RandomForestClassifier(n_estimators=50, n_jobs=3, random_state=42)
Different parameter in the grid are:
param_grid = {
'n_estimators': [200, 700],
'max_features': ['auto', 'sqrt', 'log2'],
'max_depth': [5,10],
'min_samples_split': [5,10]
}
Classifier "clf" and parameter grid "param_grid" are passed in the GridSearhCV method.
clf_rfc = GridSearchCV(estimator=clf, param_grid=param_grid)
When I fit the features with labels using
clf_rfc.fit(X_train, y_train)
I get the error "Too many indices in the array". Shape of X_train is (204,3) and of y_train is (204,1).
Tried with the option clf_rfc.fit(X_train.values, y_train.values) but could not get rid of the error.
Any suggestions would be appreciated !!