@@ -808,12 +808,6 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
808
808
"""
809
809
Logistic Regression (aka logit, MaxEnt) classifier.
810
810
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
-
817
811
This class implements regularized logistic regression using the
818
812
'liblinear' library, 'newton-cg', 'sag', 'saga' and 'lbfgs' solvers. **Note
819
813
that regularization is applied by default**. It can handle both dense
@@ -827,6 +821,11 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
827
821
the L2 penalty. The Elastic-Net regularization is only supported by the
828
822
'saga' solver.
829
823
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
+
830
829
Read more in the :ref:`User Guide <logistic_regression>`.
831
830
832
831
Parameters
@@ -904,11 +903,11 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
904
903
905
904
- For small datasets, 'liblinear' is a good choice, whereas 'sag'
906
905
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
908
907
'lbfgs' handle multinomial loss;
909
908
- 'liblinear' and 'newton-cholesky' can only handle binary classification
910
909
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`.
912
911
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
913
912
especially with one-hot encoded categorical features with rare
914
913
categories. Be aware that the memory usage of this solver has a quadratic
@@ -936,9 +935,9 @@ class LogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
936
935
a scaler from :mod:`sklearn.preprocessing`.
937
936
938
937
.. 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 >`
942
941
summarizing solver/penalty supports.
943
942
944
943
.. versionadded:: 0.17
@@ -1550,7 +1549,7 @@ class LogisticRegressionCV(LogisticRegression, LinearClassifierMixin, BaseEstima
1550
1549
because it does not handle warm-starting.
1551
1550
- 'liblinear' and 'newton-cholesky' can only handle binary classification
1552
1551
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`.
1554
1553
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
1555
1554
especially with one-hot encoded categorical features with rare
1556
1555
categories. Be aware that the memory usage of this solver has a quadratic
0 commit comments