MilesCranmer commited on
Commit
d9913e3
1 Parent(s): a55fec0

Test multi-output manual model selection

Browse files
Files changed (1) hide show
  1. test/test.py +9 -0
test/test.py CHANGED
@@ -52,6 +52,15 @@ class TestPipeline(unittest.TestCase):
52
  self.assertLessEqual(equations[0].iloc[-1]["loss"], 1e-4)
53
  self.assertLessEqual(equations[1].iloc[-1]["loss"], 1e-4)
54
 
 
 
 
 
 
 
 
 
 
55
  def test_multioutput_weighted_with_callable_temp_equation(self):
56
  y = self.X[:, [0, 1]] ** 2
57
  w = np.random.rand(*y.shape)
 
52
  self.assertLessEqual(equations[0].iloc[-1]["loss"], 1e-4)
53
  self.assertLessEqual(equations[1].iloc[-1]["loss"], 1e-4)
54
 
55
+ test_y1 = model.predict(self.X)
56
+ test_y2 = model.predict(self.X, index=[-1, -1])
57
+
58
+ mse1 = np.average((test_y1 - y) ** 2)
59
+ mse2 = np.average((test_y2 - y) ** 2)
60
+
61
+ self.assertLessEqual(mse1, 1e-4)
62
+ self.assertLessEqual(mse2, 1e-4)
63
+
64
  def test_multioutput_weighted_with_callable_temp_equation(self):
65
  y = self.X[:, [0, 1]] ** 2
66
  w = np.random.rand(*y.shape)