@@ -37,7 +37,7 @@ def test_xgbregressor_sparse_base_score(self):
37
37
expected = rf .predict (X ).astype (np .float32 ).reshape ((- 1 , 1 ))
38
38
expected_sparse = rf .predict (X_sp ).astype (np .float32 ).reshape ((- 1 , 1 ))
39
39
diff = np .abs (expected - expected_sparse )
40
- self .assertNotEqual (diff .min (), diff .max ())
40
+ self .assertNotEqual (diff .min (), diff .max (), atol = 1e-5 )
41
41
42
42
onx = convert_xgboost (
43
43
rf ,
@@ -66,7 +66,7 @@ def test_xgbregressor_sparse_no_base_score(self):
66
66
expected = rf .predict (X ).astype (np .float32 ).reshape ((- 1 , 1 ))
67
67
expected_sparse = rf .predict (X_sp ).astype (np .float32 ).reshape ((- 1 , 1 ))
68
68
diff = np .abs (expected - expected_sparse )
69
- self .assertNotEqual (diff .min (), diff .max ())
69
+ self .assertNotEqual (diff .min (), diff .max (), atol = 1e-5 )
70
70
71
71
onx = convert_xgboost (
72
72
rf ,
@@ -96,7 +96,7 @@ def test_xgbclassifier_sparse_base_score(self):
96
96
expected = rf .predict_proba (X ).astype (np .float32 ).reshape ((- 1 , 1 ))
97
97
expected_sparse = rf .predict_proba (X_sp ).astype (np .float32 ).reshape ((- 1 , 1 ))
98
98
diff = np .abs (expected - expected_sparse )
99
- self .assertNotEqual (diff .min (), diff .max ())
99
+ self .assertNotEqual (diff .min (), diff .max (), atol = 1e-5 )
100
100
101
101
onx = convert_xgboost (
102
102
rf ,
@@ -126,7 +126,7 @@ def test_xgbclassifier_sparse_no_base_score(self):
126
126
expected = rf .predict_proba (X ).astype (np .float32 ).reshape ((- 1 , 1 ))
127
127
expected_sparse = rf .predict_proba (X_sp ).astype (np .float32 ).reshape ((- 1 , 1 ))
128
128
diff = np .abs (expected - expected_sparse )
129
- self .assertNotEqual (diff .min (), diff .max ())
129
+ self .assertNotEqual (diff .min (), diff .max (), atol = 1e-5 )
130
130
131
131
onx = convert_xgboost (
132
132
rf ,
0 commit comments