MilesCranmer commited on
Commit
fd42a40
1 Parent(s): c8dffac

Add test for custom complexities

Browse files
Files changed (1) hide show
  1. test/test.py +2 -1
test/test.py CHANGED
@@ -41,11 +41,12 @@ class TestPipeline(unittest.TestCase):
41
  print(model.equations)
42
  self.assertLessEqual(model.equations.iloc[-1]["loss"], 1e-4)
43
 
44
- def test_multioutput_custom_operator_quiet(self):
45
  y = self.X[:, [0, 1]] ** 2
46
  model = PySRRegressor(
47
  unary_operators=["square_op(x) = x^2"],
48
  extra_sympy_mappings={"square_op": lambda x: x**2},
 
49
  binary_operators=["plus"],
50
  verbosity=0,
51
  **self.default_test_kwargs,
 
41
  print(model.equations)
42
  self.assertLessEqual(model.equations.iloc[-1]["loss"], 1e-4)
43
 
44
+ def test_multioutput_custom_operator_quiet_custom_complexity(self):
45
  y = self.X[:, [0, 1]] ** 2
46
  model = PySRRegressor(
47
  unary_operators=["square_op(x) = x^2"],
48
  extra_sympy_mappings={"square_op": lambda x: x**2},
49
+ complexity_of_operators={"square_op": 2, "plus": 1},
50
  binary_operators=["plus"],
51
  verbosity=0,
52
  **self.default_test_kwargs,