From 9625ecfbef0024ff4505add842b8064cedcc1482 Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Mon, 17 Oct 2022 18:06:08 +0200 Subject: [PATCH] Remove dtype checking for prediction comparison It looks like the predictions loaded from an arff file are read as floats by the arff reader, which results in a different type (float v int). Because "equality" of values is already checked, I figured dtype is not as imported. That said, I am not sure why there are so many redundant comparisons in the first place? Anyway, the difference should be due to pandas inference behavior, and if that is what we want to test, then we should make a small isolated test case instead of integrating it into every prediction unit test. --- tests/test_runs/test_run_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 89b6ef0e6..a9abcd05e 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -183,7 +183,11 @@ def _rerun_model_and_compare_predictions(self, run_id, model_prime, seed, create predictions_prime = run_prime._generate_arff_dict() self._compare_predictions(predictions, predictions_prime) - pd.testing.assert_frame_equal(run.predictions, run_prime.predictions) + pd.testing.assert_frame_equal( + run.predictions, + run_prime.predictions, + check_dtype=False, # Loaded ARFF reads NUMERIC as float, even if integer. + ) def _perform_run( self,