Skip to content

Commit 96ab0c8

Browse files
committed
Port "modifications are made for one-class svm"
Ported from cjlin1/liblinear@daeda84
1 parent 18175fc commit 96ab0c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/de/bwaldvogel/liblinear/Linear.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,9 +1939,9 @@ else if (alpha[i] > 0 && alpha[j] < 1 && -Gi + 1e-12 < -Gj)
19391939
double ub = Double.POSITIVE_INFINITY, lb = Double.NEGATIVE_INFINITY, sum_free = 0;
19401940
for (i = 0; i < l; i++) {
19411941
double G_ = SparseOperator.dot(w, prob.x[i]);
1942-
if (alpha[i] == 0)
1942+
if (alpha[i] == 1)
19431943
lb = Math.max(lb, G_);
1944-
else if (alpha[i] == 1)
1944+
else if (alpha[i] == 0)
19451945
ub = Math.min(ub, G_);
19461946
else {
19471947
++nr_free;

0 commit comments

Comments
 (0)