From c6da3139caa13e533e9fca2f912be2d99799c0e5 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Mon, 4 Sep 2023 22:20:22 -0600 Subject: [PATCH] test_coef: use RandomState object --- tests/test_coef.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_coef.py b/tests/test_coef.py index 28cc8875..c35f9685 100644 --- a/tests/test_coef.py +++ b/tests/test_coef.py @@ -345,14 +345,12 @@ def test_cm_ari_is_negative(): def test_cm_random_data(): # Prepare - np.random.seed(123) + rs = np.random.RandomState(123) for i in range(10): # two features on 100 objects (random data) - feature0 = minmax_scale( - np.random.rand(100), (-1.0, 1.0) - ) # with negative values - feature1 = np.random.rand(100) # all positive values between 0 and 1 + feature0 = minmax_scale(rs.rand(100), (-1.0, 1.0)) # with negative values + feature1 = rs.rand(100) # all positive values between 0 and 1 # Run cm_value = ccc(feature0, feature1)