You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
max_iter documentation seems wrong in LogisticRegression #13274
It seems that the documentation for max_iter is wrong in the docstring of LogisticRegression: the documentation claims that the parameter is not passed to saga and liblinear.
max_iter is clearly passed to saga.
From a cursory look at the code, it seems that it is also passed to liblinear.
The documentation should be fixed, including checking what liblinear actually does, and maybe a test should be written.
The max_iter parameter seems to be propagated all the way down to liblinear solver. I didn't check whether it's used internally by the solver, but I have no reason to believe that it's not the case. The same applies to saga solver.
The docs mention:
max_iter : int, optional (default=100)
Useful only for the newton-cg, sag and lbfgs solvers.
Maximum number of iterations taken for the solvers to converge.
/home/bartosz/repos/libraries/scikit-learn/sklearn/linear_model/sag.py:334: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
"the coef_ did not converge", ConvergenceWarning)
saga n iterations: [1]
/home/bartosz/repos/libraries/scikit-learn/sklearn/svm/base.py:927: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.
"the number of iterations.", ConvergenceWarning)
liblinear iterations: [1]
Reacted by Milica Medic Király, MarceloLandaverde and mahmudtolba
Activity
btel commentedon Feb 26, 2019
The
max_iterparameter seems to be propagated all the way down to liblinear solver. I didn't check whether it's used internally by the solver, but I have no reason to believe that it's not the case. The same applies to saga solver.The docs mention:
scikit-learn/sklearn/linear_model/logistic.py
Line 1317 in b0ab289
I guess liblinear and saga are not mentioned by omission.
btel commentedon Feb 26, 2019
Here is a sample script, which confirms the case:
which produces this output: