@@ -195,12 +195,11 @@ def test_x1_add_x2():
195195
196196 assert (len (model .bestExpressions ) == 1 )
197197 assert (model .bestExpressions [0 ][0 ] == sympy .sympify ("x1+x2" ))
198- """
198+
199199def test_x1_2_add_x2_2_sub_x1_mul_x2 ():
200200 model = sr .SR (niterations = 3 ,
201201 binary_operators = {"*" : (operator .mul , operator .mul ),
202202 "+" : (operator .add , operator .add )},
203- discrete_param_values = ["(-1, 1)"],
204203 foundBreak = True )
205204
206205 n = 10
@@ -213,7 +212,7 @@ def test_x1_2_add_x2_2_sub_x1_mul_x2():
213212
214213 assert (len (model .bestExpressions ) == 1 )
215214 assert (sr .expr_eq (sympy .expand (model .bestExpressions [0 ][0 ]), sympy .expand (sympy .sympify ("(x1-x2)**2+x1*x2" ))))
216- """
215+
217216def test_a_mul_x1_add_b ():
218217 model = sr .SR (niterations = 3 ,
219218 binary_operators = {"+" : (operator .add , operator .add )},
@@ -261,7 +260,7 @@ def test_pysr():
261260 binary_operators = {"+" : (operator .add , operator .add ),
262261 "*" : (operator .mul , operator .mul )},
263262 operator_depth = {"cos" : 1 },
264- discrete_param_values = [0 , 1 , - 0.5 , 2.5382 ],
263+ # discrete_param_values = [0, 1, -0.5, 2.5382],
265264 foundBreak = True ,
266265 eps = 1e-6 )
267266
@@ -384,7 +383,7 @@ def test_plane():
384383 model .fit ([x , y , z ], np .zeros (len (x )), ["x" , "y" , "z" ])
385384
386385 assert (sr .sym_expr_eq (model .bestExpressions [0 ][0 ], sympy .sympify ("a * x + b * y + c * z + d" ), sympy .symbols ("x y z" )))
387- """
386+
388387def test_sphere ():
389388 p0 = 10 * np .random .rand (3 ) - 5 * np .ones (3 )
390389 p0 = np .array ([1. , 2. , 3. ])
@@ -418,7 +417,7 @@ def test_sphere():
418417
419418 assert (len (model .bestExpressions ) >= 1 )
420419 assert (sr .sym_expr_eq (model .bestExpressions [0 ][0 ], sympy .sympify ("a * ((x - x0) ** 2 + (y - y0) ** 2 + (z - z0) ** 2 - R ** 2)" ), sympy .symbols ("x y z" )))
421- """
420+
422421def test_gplearn ():
423422 from sklearn .utils .random import check_random_state
424423
@@ -499,7 +498,6 @@ def test_3():
499498 foundBreak = True ,
500499 #verbose = True,
501500 )
502- #Ajouter du code pour ordonner les tâches des moins complexes aux plus complexes
503501
504502 n = 100
505503 xmin = - 5
0 commit comments