Skip to content

Commit

Permalink
test_coef: use RandomState object
Browse files Browse the repository at this point in the history
  • Loading branch information
miltondp committed Sep 5, 2023
1 parent 01df4d1 commit c6da313
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_coef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c6da313

Please sign in to comment.