示例#1
0
 def test_fit_returns_self(self):
     """Tests if the `fit()` method returns `self`. This allows to quickly implement one-liners with AutoML"""
     model = AutoML()
     model.results_path = self.automl_dir
     self.assertTrue(
         isinstance(model.fit(iris.data, iris.target), AutoML),
         "`fit()` method must return 'self'",
     )
示例#2
0
 def test_no_constructor_args(self):
     """Tests the use of AutoML without passing any args. Should work without any arguments"""
     # Create model with no arguments
     model = AutoML()
     model.results_path = self.automl_dir
     # Assert than an Exception is raised
     score = model.fit(iris.data, iris.target).score(iris.data, iris.target)
     self.assertGreater(score, 0.5)