Repository: scikit-learn/scikit-learn
Pull request: DOC : fixing missing solvers in logreg doc
#### Reference Issues/PRs

Fixes #13274

#### What does this implement/fix? Explain your changes.

Added liblinear and saga in the docstring following @GaelVaroquaux issue and @btel test

Problem statement:
max_iter documentation seems wrong in LogisticRegression
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.

Hints from issue discussion:
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.

https://github.com/scikit-learn/scikit-learn/blob/b0ab2891b6db347fe91ac0bde34da0b498c7fbca/sklearn/linear_model/logistic.py#L1317

I guess liblinear and saga are not mentioned by omission.
Here is a sample script, which confirms the case:

```python
from sklearn.linear_model import LogisticRegression
import numpy as np

X = np.random.rand(100, 2)
y = X.sum(1) > 0.8

logreg = LogisticRegression(solver='saga', max_iter=1)
logreg.fit(X, y)

print("saga n iterations:", logreg.n_iter_)

logreg = LogisticRegression(solver='liblinear', max_iter=1)
logreg.fit(X, y)

print("liblinear iterations:", logreg.n_iter_)
```

which produces this output:

```
/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]
```

Commit message: fixing missing solvers in logreg doc

Patch to review:
diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py
index d593ffbff0eab..5f8b0eda860b8 100644
--- a/sklearn/linear_model/logistic.py
+++ b/sklearn/linear_model/logistic.py
@@ -1315,7 +1315,7 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin,
             Default will change from 'liblinear' to 'lbfgs' in 0.22.
 
     max_iter : int, optional (default=100)
-        Useful only for the newton-cg, sag and lbfgs solvers.
+        Useful only for the newton-cg, sag, lbfgs, liblinear and saga solvers.
         Maximum number of iterations taken for the solvers to converge.
 
     multi_class : str, {'ovr', 'multinomial', 'auto'}, optional (default='ovr')


Code review comments:
diff_hunk: @@ -1315,7 +1315,7 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin,
             Default will change from 'liblinear' to 'lbfgs' in 0.22.
 
     max_iter : int, optional (default=100)
-        Useful only for the newton-cg, sag and lbfgs solvers.
+        Useful only for the newton-cg, sag, lbfgs, liblinear and saga solvers.
path: sklearn/linear_model/logistic.py
text: @user1:
I guess we should simply remove this line, because this list includes all supported solvers.

@user2:
+1
I would just write:

`The maximum number of iterations used by the solver.`

@user3:
+1

@author:
Makes sense, simplification incoming...