Reputation: 4731
From scikit-learn's documentation, the default penalty is "l2", and C (inverse of regularization strength) is "1". If I keep this setting penalty='l2' and C=1.0, does it mean the training algorithm is an unregularized logistic regression? In contrast, when C is anything other than 1.0, then it's a regularized logistic regression classifier?
Upvotes: 1
Views: 2345
Reputation: 195
first, set C
to a large value (relative to your expected coefficients).
If it does not work for you, also set penalty='l1'
Upvotes: 0
Reputation: 33542
No, it's not like that.
Let's have a look at the definitions within sklearn's user-guide:
C
is multiplied with the loss while the left-term (regularization) is untouchedC
to a huge number!
C
decreases the relevance of the regularization-penaltyUpvotes: 4