Last Updated on 2021-10-30 by Clay
The full error message as follows:
Start to train the model.
\sklearn\linear_model\_logistic.py:763: 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 n_iter_i = _check_optimize_result(
\sklearn\linear_model\_logistic.py:763: 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 n_iter_i = _check_optimize_result(
The meaning of the error message is lbfgs cannot converge because the iteration number is limited and aborted.
Solution
There are three solutions:
- Increase the iterable number (
max_iter
default is 100) - Reduce the data scale
- Change the solver
References
- https://stackoverflow.com/questions/62658215/convergencewarning-lbfgs-failed-to-converge-status-1-stop-total-no-of-iter
- https://stats.stackexchange.com/questions/184017/how-to-fix-non-convergence-in-logisticregressioncv
- https://github.com/scikit-learn/scikit-learn/issues/10866
Pingback: Lbfgs Failed To Converge? Top 9 Best Answers - Ar.taphoamini.com
Pingback: Best 14 Stop: Total No. Of Iterations Reached Limit. - Ôn Thi HSG