Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 89f940ce authored by ANDREY Paul's avatar ANDREY Paul
Browse files

Add a seed to 'test_rsquared.py' to avoid random failures due to numerical precision.

parent 71debe68
No related branches found
No related tags found
No related merge requests found
Pipeline #764190 waiting for manual action
......@@ -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,))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment