From 89f940cedd00b353155de9d31fa57d8f76eaf85f Mon Sep 17 00:00:00 2001 From: Paul Andrey <paul.andrey@inria.fr> Date: Wed, 1 Mar 2023 14:17:28 +0100 Subject: [PATCH] Add a seed to 'test_rsquared.py' to avoid random failures due to numerical precision. --- test/metrics/test_rsquared.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/metrics/test_rsquared.py b/test/metrics/test_rsquared.py index ccf080a4..cdc2518e 100644 --- a/test/metrics/test_rsquared.py +++ b/test/metrics/test_rsquared.py @@ -44,6 +44,7 @@ def test_case_fixture( ) -> MetricTestCase: """Return a test case for an R2 metric, with opt. sample weights.""" # Generate random inputs and sample weights. + np.random.seed(20230301) y_true = np.random.normal(scale=1.0, size=32) y_pred = y_true + np.random.normal(scale=0.5, size=32) s_wght = np.abs(np.random.normal(size=32)) if weighted else np.ones((32,)) -- GitLab