Skip to content

Commit 851d914

Browse files
committed
DOC: add transpose and intercept to formula of logistic regression
1 parent c73c9a1 commit 851d914

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/modules/linear_model.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,11 @@ The :class:`LogisticRegression` class can be used to do L1 or L2 penalized
653653
logistic regression. Binary class L2 penalized logistic regression can be
654654
formulated as the solution to the optimization problem
655655

656-
.. math:: \underset{w}{min\,} \frac{1}{2}w^T w + C \sum_{i=1}^n \log(\exp(- y_i X_i w) + 1)
656+
.. math:: \underset{w, c}{min\,} \frac{1}{2}w^T w + C \sum_{i=1}^n \log(\exp(- y_i (X_i^T w + c)) + 1)
657657

658658
Similarly, L1 regularized logistic regression solves the following optimization problem
659659

660-
.. math:: \underset{w}{min\,} \|w\|_1 + C \sum_{i=1}^n \log(\exp(- y_i X_i w) + 1)
660+
.. math:: \underset{w, c}{min\,} \|w\|_1 + C \sum_{i=1}^n \log(\exp(- y_i (X_i^T w + c)) + 1)
661661

662662
L1 penalization yields sparse predicting weights.
663663
For L1 penalization :func:`sklearn.svm.l1_min_c` allows to calculate

0 commit comments

Comments
 (0)