8000 DOC Remove mention of deprecated `multi_class` in `LogisticRegression… · gregoryschwartzman/scikit-learn@3dac188 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3dac188

Browse files
lucyleeowBenJourdan
authored andcommitted
DOC Remove mention of deprecated multi_class in LogisticRegression (scikit-learn#29998)
1 parent 1c1f534 commit 3dac188

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

doc/modules/linear_model.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,8 @@ logistic regression, see also `log-linear model
10001000
| `ElasticNet` | :math:`\frac{1 - \rho}{2}\|W\|_F^2 + \rho \|W\|_{1,1}` |
10011001
+----------------+----------------------------------------------------------------------------------+
10021002

1003+
.. _logistic_regression_solvers:
1004+
10031005
Solvers
10041006
-------
10051007

sklearn/linear_model/_logistic.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,6 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
808808
"""
809809
Logistic Regression (aka logit, MaxEnt) classifier.
810810
811-
In the multiclass case, the training algorithm uses the one-vs-rest (OvR)
812-
scheme if the 'multi_class' option is set to 'ovr', and uses the
813-
cross-entropy loss if the 'multi_class' option is set to 'multinomial'.
814-
(Currently the 'multinomial' option is supported only by the 'lbfgs',
815-
'sag', 'saga' and 'newton-cg' solvers.)
816-
817811
This class implements regularized logistic regression using the
818812
'liblinear' library, 'newton-cg', 'sag', 'saga' and 'lbfgs' solvers. **Note
819813
that regularization is applied by default**. It can handle both dense
@@ -827,6 +821,11 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
827821
the L2 penalty. The Elastic-Net regularization is only supported by the
828822
'saga' solver.
829823
824+
For :term:`multiclass` problems, only 'newton-cg', 'sag', 'saga' and 'lbfgs'
825+
handle multinomial loss. 'liblinear' and 'newton-cholesky' only handle binary
826+
classification but can be extended to handle multiclass by using
827+
:class:`~sklearn.multiclass.OneVsRestClassifier`.
828+
830829
Read more in the :ref:`User Guide <logistic_regression>`.
831830
832831
Parameters
@@ -904,11 +903,11 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
904903
905904
- For small datasets, 'liblinear' is a good choice, whereas 'sag'
906905
and 'saga' are faster for large ones;
907-
- For multiclass problems, only 'newton-cg', 'sag', 'saga' and
906+
- For :term:`multiclass` problems, only 'newton-cg', 'sag', 'saga' and
908907
'lbfgs' handle multinomial loss;
909908
- 'liblinear' and 'newton-cholesky' can only handle binary classification
910909
by default. To apply a one-versus-rest scheme for the multiclass setting
911-
one can wrapt it with the `OneVsRestClassifier`.
910+
one can wrap it with the :class:`~sklearn.multiclass.OneVsRestClassifier`.
912911
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
913912
especially with one-hot encoded categorical features with rare
914913
categories. Be aware that the memory usage of this solver has a quadratic
@@ -936,9 +935,9 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
936935
a scaler from :mod:`sklearn.preprocessing`.
937936
938937
.. seealso::
939-
Refer to the User Guide for more information regarding
940-
:class:`LogisticRegression` and more specifically the
941-
:ref:`Table <Logistic_regression>`
938+
Refer to the :ref:`User Guide <Logistic_regression>` for more
939+
information regarding :class:`LogisticRegression` and more specifically the
940+
:ref:`Table <logistic_regression_solvers>`
942941
summarizing solver/penalty supports.
943942
944943
.. versionadded:: 0.17
@@ -1550,7 +1549,7 @@ class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstima
15501549
because it does not handle warm-starting.
15511550
- 'liblinear' and 'newton-cholesky' can only handle binary classification
15521551
by default. To apply a one-versus-rest scheme for the multiclass setting
1553-
one can wrapt it with the `OneVsRestClassifier`.
1552+
one can wrap it with the :class:`~sklearn.multiclass.OneVsRestClassifier`.
15541553
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
15551554
especially with one-hot encoded categorical features with rare
15561555
categories. Be aware that the memory usage of this solver has a quadratic

0 commit comments

Comments
 (0)
0