Skip to content

Commit 9c311b6

Browse files
committed
fix(test): Fix RF and GB tests to match rounded scores
1 parent efedd52 commit 9c311b6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/prediction/gradient_boosting_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def test_gradient_boosting_regressor():
4040
np.testing.assert_equal(len(predicted_labels), len(Y_IRIS))
4141

4242
np.testing.assert_equal(count_false, 150)
43-
np.testing.assert_almost_equal(out_metrics["mae"], 0.03101, decimal=4)
44-
np.testing.assert_almost_equal(out_metrics["mse"], 0.00434, decimal=4)
45-
np.testing.assert_almost_equal(out_metrics["rmse"], 0.06593, decimal=4)
46-
np.testing.assert_almost_equal(out_metrics["r2"], 0.99377, decimal=4)
43+
np.testing.assert_equal(out_metrics["mae"], 0.031)
44+
np.testing.assert_equal(out_metrics["mse"], 0.004)
45+
np.testing.assert_equal(out_metrics["rmse"], 0.066)
46+
np.testing.assert_equal(out_metrics["r2"], 0.994)
4747

4848

4949
def test_invalid_learning_rate():

tests/prediction/random_forest_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def test_random_forest_regressor():
3737
np.testing.assert_equal(len(predicted_labels), len(Y_IRIS))
3838

3939
np.testing.assert_equal(count_false, 35)
40-
np.testing.assert_almost_equal(out_metrics["mae"], 0.01366, decimal=4)
41-
np.testing.assert_almost_equal(out_metrics["mse"], 0.00138, decimal=4)
42-
np.testing.assert_almost_equal(out_metrics["rmse"], 0.03719, decimal=4)
43-
np.testing.assert_almost_equal(out_metrics["r2"], 0.99802, decimal=4)
40+
np.testing.assert_equal(out_metrics["mae"], 0.014)
41+
np.testing.assert_equal(out_metrics["mse"], 0.001)
42+
np.testing.assert_equal(out_metrics["rmse"], 0.037)
43+
np.testing.assert_equal(out_metrics["r2"], 0.998)
4444

4545

4646
def test_random_forest_invalid_n_estimators():

0 commit comments

Comments
 (0)