成功解决ConvergenceWarning: lbfgs failed to converge (status=1): STOP: TOTAL NO. of ITERATIONS REACHED L
成功解决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:
解决问题
F:\Program Files\Python\Python36\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)
解决思路
收敛警告:lbfgs无法聚合(状态=1):
停止:迭代总数达到限制。
增加迭代次数(最大值)或缩放数据,如中所示:https://scikit-learn.org/stable/modules/preprocessing.html
另请参阅文档以了解其他解算器选项:https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression%20%C2%A0%20extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
解决方法
迭代总数达到限制。增加迭代次数(最大值)或缩放数据.scikit-learn版本问题导致的匹配警告和收敛警告,调用的函数和方法已经有改变,暂时不处理也不会影响程序运行。
建议升级版本或者修改为最新版本的用法,合理使用库函数!