pythonのランダムフォレストでグリッドサーチをかけたいのですがエラーが出てしまいます。
python
1parameters = { 2 'n_estimators' : [5, 10, 30, 50, 100, 500], 3 'max_features' : [3, 5, 10], 4 'random_state' : [3], 5 'min_samples_split' : [3, 5, 10, 20, 50, 100], 6 'max_depth' : [3, 5, 10] 7} 8 9classifier = GridSearchCV(RandomForestClassifier(), parameters) 10classifier.fit(x_train, y_train) 11print(classifier.best_estimator_)
エラーは、このようなに出てきます。
IndexError: too many indices for array
shapeでx_train, y_trainを見てみると
print(x_train.shape)
print(y_train.shape)
(12999, 9901)
(12999, 1)
このように出てきます。
ご教授お願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/22 09:13
2017/08/22 09:45
2017/08/22 12:31