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 /test | |
| parent | update version (diff) | |
| download | pygensvm-ad5b0a7800518baf4ac450257d045e5fa2e735d0.tar.gz pygensvm-ad5b0a7800518baf4ac450257d045e5fa2e735d0.zip | |
bugfix for predict with gamma = 'auto'
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_core.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_core.py b/test/test_core.py index 0a1042a..63c172d 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -197,6 +197,23 @@ class GenSVMTestCase(unittest.TestCase): set(pred).issubset(set(["versicolor", "virginica", "setosa"])) ) + def test_fit_nonlinear_auto(self): + """ GENSVM: Fit and predict with nonlinear kernel """ + data = load_iris() + X = data.data + y = data.target_names[data.target] + + X_train, X_test, y_train, y_test = train_test_split( + X, y, random_state=123 + ) + clf = GenSVM(kernel="rbf", max_iter=1000, random_state=123) + clf.fit(X_train, y_train) + + pred = clf.predict(X_test, trainX=X_train) + self.assertTrue( + set(pred).issubset(set(["versicolor", "virginica", "setosa"])) + ) + def test_fit_with_seed(self): """ GENSVM: Test fit with seeding """ |
