diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-05-17 15:17:32 -0400 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-05-17 15:17:32 -0400 |
| commit | ad5b0a7800518baf4ac450257d045e5fa2e735d0 (patch) | |
| tree | f16b60a75ffa60026e1b165a7a216db02442c0bb /gensvm | |
| parent | update version (diff) | |
| download | pygensvm-ad5b0a7800518baf4ac450257d045e5fa2e735d0.tar.gz pygensvm-ad5b0a7800518baf4ac450257d045e5fa2e735d0.zip | |
bugfix for predict with gamma = 'auto'
Diffstat (limited to 'gensvm')
| -rw-r--r-- | gensvm/__init__.py | 2 | ||||
| -rw-r--r-- | gensvm/core.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gensvm/__init__.py b/gensvm/__init__.py index 62ac067..c8cd0be 100644 --- a/gensvm/__init__.py +++ b/gensvm/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = "0.2.2" +__version__ = "0.2.3" from .core import GenSVM from .gridsearch import GenSVMGridSearchCV 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, |
