From ad5b0a7800518baf4ac450257d045e5fa2e735d0 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 17 May 2019 15:17:32 -0400 Subject: bugfix for predict with gamma = 'auto' --- gensvm/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gensvm/core.py') diff --git a/gensvm/core.py b/gensvm/core.py index c994995..f0e7820 100644 --- a/gensvm/core.py +++ b/gensvm/core.py @@ -408,6 +408,8 @@ class GenSVM(BaseEstimator, ClassifierMixin): trainX, accept_sparse=False, dtype=np.float64, order="C" ) + gamma = 1.0 / X.shape[1] if self.gamma == "auto" else self.gamma + V = self.combined_coef_ if self.kernel == "linear": predictions = wrapper.predict_wrap(X, V) @@ -420,7 +422,7 @@ class GenSVM(BaseEstimator, ClassifierMixin): V, n_class, kernel_idx, - self.gamma, + gamma, self.coef, self.degree, self.kernel_eigen_cutoff, -- cgit v1.2.3