您当前的位置: 首页 >  Python

星拱北辰

暂无认证

  • 0浏览

    0关注

    1205博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

【Python】处理ConvergenceWarning: lbfgs failed to converge (status=1):STOP: ...

星拱北辰 发布时间:2020-09-26 18:50:21 ,浏览量:0

又是红了一大片:

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)

看异常栈,反复出现 max_iter,问题就在于我写的是logit = LogisticRegression(),应该改成logit = LogisticRegression(max_iter=10000),这样就OK了。

关注
打赏
1660750074
查看更多评论
立即登录/注册

微信扫码登录

0.0589s