def test_manual_grid(self): from sklearn.datasets import load_iris from lale.lib.lale import GridSearchCV from lale.lib.sklearn import SVC warnings.simplefilter("ignore") from lale import wrap_imported_operators wrap_imported_operators() iris = load_iris() parameters = {"kernel": ("linear", "rbf"), "C": [1, 10]} svc = SVC() clf = GridSearchCV(estimator=svc, param_grid=parameters) clf.fit(iris.data, iris.target) clf.predict(iris.data)
def test_break_ties(self): with self.assertRaisesRegex(jsonschema.ValidationError, "argument 'break_ties' was unexpected"): _ = SVC(break_ties=True)
def test_gamma(self): default = SVC.hyperparam_defaults()["gamma"] self.assertEqual(default, "auto_deprecated")
def test_with_defaults(self): trainable = SVC() trained = trainable.fit(self.train_X, self.train_y) _ = trained.predict(self.test_X)
def test_svc(self): from lale.lib.sklearn import SVC reg = SVC(kernel='linear', gamma=1) reg.fit(self.X_train, self.y_train)
def test_svc(self): reg = SVC(kernel="linear", gamma=1) reg.fit(self.X_train, self.y_train)
def test_gamma(self): default = SVC.hyperparam_defaults()['gamma'] self.assertEqual(default, 'auto_deprecated')