@@ -102,15 +102,15 @@ def test_criterions(self):
102102 assert_criterion_equal (c1 , c2 )
103103 left1 , right1 = _test_criterion_node_impurity_children (c1 )
104104 left2 , right2 = _test_criterion_node_impurity_children (c2 )
105- self .assertAlmostEqual (left1 , left2 )
106- self .assertAlmostEqual (right1 , right2 )
105+ self .assertAlmostEqual (left1 , left2 , atol = 1e-8 )
106+ self .assertAlmostEqual (right1 , right2 , atol = 1e-8 )
107107 v1 = _test_criterion_node_value (c1 )
108108 v2 = _test_criterion_node_value (c2 )
109109 self .assertEqual (v1 , v2 )
110110 assert_criterion_equal (c1 , c2 )
111111 p1 = _test_criterion_impurity_improvement (c1 , 0.0 , left1 , right1 )
112112 p2 = _test_criterion_impurity_improvement (c2 , 0.0 , left2 , right2 )
113- self .assertAlmostEqual (p1 , p2 )
113+ self .assertAlmostEqual (p1 , p2 , atol = 1e-8 )
114114
115115 X = numpy .array ([[1.0 , 2.0 , 10.0 , 11.0 ]]).T
116116 y = numpy .array ([0.9 , 1.1 , 1.9 , 2.1 ])
@@ -123,7 +123,7 @@ def test_criterions(self):
123123 _test_criterion_init (c2 , ys , w , 1.0 , ind , 1 , y .shape [0 ])
124124 i1 = _test_criterion_node_impurity (c1 )
125125 i2 = _test_criterion_node_impurity (c2 )
126- self .assertAlmostEqual (i1 , i2 )
126+ self .assertAlmostEqual (i1 , i2 , atol = 1e-8 )
127127 v1 = _test_criterion_node_value (c1 )
128128 v2 = _test_criterion_node_value (c2 )
129129 self .assertEqual (v1 , v2 )
@@ -136,14 +136,14 @@ def test_criterions(self):
136136 _test_criterion_update (c2 , i )
137137 left1 , right1 = _test_criterion_node_impurity_children (c1 )
138138 left2 , right2 = _test_criterion_node_impurity_children (c2 )
139- self .assertAlmostEqual (left1 , left2 )
140- self .assertAlmostEqual (right1 , right2 )
139+ self .assertAlmostEqual (left1 , left2 , atol = 1e-8 )
140+ self .assertAlmostEqual (right1 , right2 , atol = 1e-8 )
141141 v1 = _test_criterion_node_value (c1 )
142142 v2 = _test_criterion_node_value (c2 )
143143 self .assertEqual (v1 , v2 )
144144 p1 = _test_criterion_impurity_improvement (c1 , 0.0 , left1 , right1 )
145145 p2 = _test_criterion_impurity_improvement (c2 , 0.0 , left2 , right2 )
146- self .assertAlmostEqual (p1 , p2 )
146+ self .assertAlmostEqual (p1 , p2 , atol = 1e-8 )
147147
148148 @unittest .skipIf (
149149 pv .Version (skl_ver ) < pv .Version ("1.3.3" ),
0 commit comments