8000 ENH liblinear: cythonized sign switch for n_class<=2 · scikit-learn/scikit-learn@d0d595d · GitHub
[go: up one dir, main page]

Skip to content

Commit d0d595d

Browse files
committed
ENH liblinear: cythonized sign switch for n_class<=2
1 parent 3e4b6df commit d0d595d

File tree

4 files changed

+422
-328
lines changed

4 files changed

+422
-328
lines changed

sklearn/svm/base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,7 @@ def decision_function(self, X):
504504
self.C, self.class_weight_label, self.class_weight,
505505
self.label_, self._get_bias())
506506

507-
if len(self.label_) <= 2:
508-
# in the two-class case, the decision sign needs be flipped
509-
# due to liblinear's design
510-
return -dec_func
511-
else:
512-
return dec_func
507+
return dec_func
513508

514509
def _check_n_features(self, X):
515510
n_features = self.raw_coef_.shape[1]

0 commit comments

Comments
 (0)
0