現在Google Colaboratoryを用いてpythonで機械学習を行っています.
しかし謎のエラーに阻まれてしまいました.
原因は不明です. 本来なら95.3333333333といった数値が出るはずなのに,エラーのせいか異なる値が表示されてしまいます.
どなたか解決法をお教えください...
python
1from sklearn.model_selection import LeaveOneOut 2loo=LeaveOneOut() 3 4score = cross_val_score(logreg, iris.data, iris.target, cv = loo) #分類器としてLeaveOneOut()を指定 5score.mean() #=> 0.95333333333333337
下のようなエラーが無数に表示されます...
error
1/usr/local/lib/python3.6/dist-packages/sklearn/linear_model/_logistic.py:940: ConvergenceWarning: lbfgs failed to converge (status=1): 2STOP: TOTAL NO. of ITERATIONS REACHED LIMIT. 3 4Increase the number of iterations (max_iter) or scale the data as shown in: 5 https://scikit-learn.org/stable/modules/preprocessing.html 6Please also refer to the documentation for alternative solver options: 7 https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression 8 extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG) 9/usr/local/lib/python3.6/dist-packages/sklearn/linear_model/_logistic.py:940: ConvergenceWarning: lbfgs failed to converge (status=1): 10STOP: TOTAL NO. of ITERATIONS REACHED LIMIT. 11 12Increase the number of iterations (max_iter) or scale the data as shown in: 13 https://scikit-learn.org/stable/modules/preprocessing.html 14Please also refer to the documentation for alternative solver options: 15 https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression 16 extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG) 17/usr/local/lib/python3.6/dist-packages/sklearn/linear_model/_logistic.py:940: ConvergenceWarning: lbfgs failed to converge (status=1): 18STOP: TOTAL NO. of ITERATIONS REACHED LIMIT. 19
回答1件
あなたの回答
tips
プレビュー