MilesCranmer commited on
Commit
0fba777
1 Parent(s): 0020398

Test more parts of sklearn API

Browse files
Files changed (1) hide show
  1. test/test.py +9 -0
test/test.py CHANGED
@@ -95,6 +95,15 @@ class TestPipeline(unittest.TestCase):
95
  self.assertLessEqual(regressor.equations.iloc[-1]["MSE"], 1e-4)
96
  np.testing.assert_almost_equal(regressor.predict(X), y, decimal=1)
97
 
 
 
 
 
 
 
 
 
 
98
  def test_noisy(self):
99
 
100
  np.random.seed(1)
 
95
  self.assertLessEqual(regressor.equations.iloc[-1]["MSE"], 1e-4)
96
  np.testing.assert_almost_equal(regressor.predict(X), y, decimal=1)
97
 
98
+ # Tweak model selection:
99
+ regressor.set_params(model_selection="best")
100
+ self.assertEqual(regressor.get_params()["model_selection"], "best")
101
+ self.assertTrue("None" not in regressor.__repr__())
102
+ self.assertTrue(">>>>" in regressor.__repr__())
103
+
104
+ # "best" model_selection should also give a decent loss:
105
+ np.testing.assert_almost_equal(regressor.predict(X), y, decimal=1)
106
+
107
  def test_noisy(self):
108
 
109
  np.random.seed(1)