Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何绕过此错误消息:lbfgs未能收敛(状态=1):停止:达到限制的迭代总数_Python - Fatal编程技术网

Python 如何绕过此错误消息:lbfgs未能收敛(状态=1):停止:达到限制的迭代总数

Python 如何绕过此错误消息:lbfgs未能收敛(状态=1):停止:达到限制的迭代总数,python,Python,我目前正在与scikit图书馆、Pickle和Pandas合作。我正在编辑我的csv文件,分析它并将其上载到PKL文件。当我运行我的方法时,总是会收到一条错误消息: C:\Python\Python37\lib\site-packages\sklearn\linear_model\_logistic.py:765: ConvergenceWarning: lbfgs failed to converge (status=1): STOP: TOTAL NO. of ITERATIONS REAC

我目前正在与scikit图书馆、Pickle和Pandas合作。我正在编辑我的csv文件,分析它并将其上载到PKL文件。当我运行我的方法时,总是会收到一条错误消息:

C:\Python\Python37\lib\site-packages\sklearn\linear_model\_logistic.py:765: 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)
我知道这不是Python特有的问题,但与我正在使用的scikit库有关。我还增加了max_iter参数的值:

log_eg = LogisticRegression(solver='lbfgs', class_weight='balanced', max_iter= 1000)
是否有其他方法可以绕过此错误消息?我怎样才能避开这个错误消息

这意味着什么

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)

可以更改逻辑回归中使用的解算器,请选中。也许如果你使用另一个解算器,它会收敛得更快。@PaulSnopov我会试试。谢谢。