File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -385,13 +385,17 @@ def compute_ccc_perms(params) -> NDArray[float]:
385
385
Returns:
386
386
The CCC coefficient values using the permuted partitions of one of the features.
387
387
"""
388
+ # since this function can be parallelized across different processes, make sure
389
+ # the random number generator is initialized with a different seed for each process
390
+ rng = np .random .default_rng ()
391
+
388
392
_ , obj_parts_i , obj_parts_j , n_perms = params
389
393
390
394
n_objects = obj_parts_i .shape [1 ]
391
395
ccc_perm_values = np .full (n_perms , np .nan , dtype = float )
392
396
393
397
for idx in range (n_perms ):
394
- perm_idx = np . random .permutation (n_objects )
398
+ perm_idx = rng .permutation (n_objects )
395
399
396
400
# generate a random permutation of the partitions of one
397
401
# variable/feature
You can’t perform that action at this time.
0 commit comments