Skip to content

Commit 6331623

Browse files
committed
FIX restore _pairwise on SVMs
Added a comment explaining what this property does. This time, did a *full* test and only got an unrelated error. Sorry for the noise.
1 parent 8e5055f commit 6331623

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sklearn/svm/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def __init__(self, impl, kernel, degree, gamma, coef0,
9191
self.max_iter = max_iter
9292
self.random_state = random_state
9393

94+
@property
95+
def _pairwise(self):
96+
# Used by cross_val_score.
97+
kernel = self.kernel
98+
return kernel == "precomputed" or callable(kernel)
99+
94100
def fit(self, X, y, sample_weight=None):
95101
"""Fit the SVM model according to the given training data.
96102

0 commit comments

Comments
 (0)