【Python】处理ConvergenceWarning: lbfgs failed to converge (status=1):STOP: ...
又是紅了一大片:
D:\PyCharm\machine_learning_py_codes\venv\lib\site-packages\sklearn\linear_model_logistic.py:764: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
Increase the number of iterations (max_iter) or scale the data as shown in:
??https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
??https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
?extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
D:\PyCharm\machine_learning_py_codes\venv\lib\site-packages\sklearn\linear_model_logistic.py:764: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
Increase the number of iterations (max_iter) or scale the data as shown in:
??https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
??https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
?extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
D:\PyCharm\machine_learning_py_codes\venv\lib\site-packages\sklearn\linear_model_logistic.py:764: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
Increase the number of iterations (max_iter) or scale the data as shown in:
??https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
??https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
?extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
D:\PyCharm\machine_learning_py_codes\venv\lib\site-packages\sklearn\linear_model_logistic.py:764: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.
Increase the number of iterations (max_iter) or scale the data as shown in:
??https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
??https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
?extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
看異常棧,反復出現(xiàn) max_iter,問題就在于我寫的是logit = LogisticRegression(),應該改成logit = LogisticRegression(max_iter=10000),這樣就OK了。
總結
以上是生活随笔為你收集整理的【Python】处理ConvergenceWarning: lbfgs failed to converge (status=1):STOP: ...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Java】CMD编译Java源码遇到\
- 下一篇: 【Git】从GitHub到本地clone