グリッドサーチを実行させると、エラーが発生します。
処理は正常に終了しているようなのですが、このエラーが気になります。。
無視しても大丈夫なのでしょうか?
お詳しい方、ご指導をお願いいたします。
from sklearn.svm import SVC from sklearn.model_selection import GridSearchCV param_grid = {'C': [0.1, 1, 10, 100, 1000], 'gamma': [1, 0.1, 0.01, 0.001, 0.0001], 'kernel': ['rbf']} #'kernel': ['linear']} clf = GridSearchCV(SVC(), param_grid, refit = True, verbose = 3) # 訓練データとラベルで学習 clf.fit(x_train, y_train) # 最も良いパラメータとスコア print(clf.best_params_) print(clf.best_score_)
C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) [CV] .... C=1000, gamma=0.0001, kernel=rbf, score=0.646, total= 0.0s [CV] C=1000, gamma=0.0001, kernel=rbf ................................ [CV] .... C=1000, gamma=0.0001, kernel=rbf, score=0.585, total= 0.0s {'C': 1000, 'gamma': 1, 'kernel': 'rbf'} 0.7097902097902098 C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) C:\python\anaconda\pgm\lib\site-packages\sklearn\utils\validation.py:724: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/25 03:53
2019/10/25 04:02
2019/10/25 05:15
2019/10/25 05:25
2019/10/25 05:34
2019/10/25 05:45 編集
2019/10/25 06:09