Skip to content

Commit 18175fc

Browse files
committed
Port "add -R explanation in README (and mention that generally it's not needed)"
Ported from cjlin1/liblinear@c3af75a
1 parent baa88ac commit 18175fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,15 @@ where
261261

262262
Q is a matrix with Q_ij = x_i^T x_j.
263263

264-
If `bias >= 0`, w becomes `[w; w_{n+1}]` and x becomes `[x; bias]`.
264+
If `bias >= 0`, w becomes `[w; w_{n+1}]` and x becomes `[x; bias]`. For
265+
example, L2-regularized logistic regression (-s 0) becomes
266+
267+
min_w w^Tw/2 + (w_{n+1})^2/2 + C \sum log(1 + exp(-y_i [w; w_{n+1}]^T[x_i; bias]))
268+
269+
Some may prefer not having `(w_{n+1})^2/2` (i.e., bias variable not
270+
regularized). For primal solvers (-s 0, 2, 5, 6, 11), we provide an
271+
option -R to remove `(w_{n+1})^2/2`. However, -R is generally not needed
272+
as for most data with/without `(w_{n+1})^2/2` give similar performances.
265273

266274
The primal-dual relationship implies that -s 1 and -s 2 give the same
267275
model, -s 0 and -s 7 give the same, and -s 11 and -s 12 give the same.

0 commit comments

Comments
 (0)