@@ -20,7 +20,7 @@ def test_cm_basic_pvalue_n_permutations_not_given():
20
20
feature1 = rs .rand (100 )
21
21
22
22
# Run
23
- cm_value = ccc (feature0 , feature1 , pvalue_n_permutations = None )
23
+ cm_value = ccc (feature0 , feature1 , pvalue_n_perms = None )
24
24
25
25
# Validate
26
26
assert cm_value is not None
@@ -37,7 +37,7 @@ def test_cm_basic_pvalue_n_permutations_is_zero():
37
37
feature1 = rs .rand (100 )
38
38
39
39
# Run
40
- cm_value = ccc (feature0 , feature1 , pvalue_n_permutations = 0 )
40
+ cm_value = ccc (feature0 , feature1 , pvalue_n_perms = 0 )
41
41
42
42
# Validate
43
43
assert cm_value is not None
@@ -54,7 +54,7 @@ def test_cm_basic_pvalue_n_permutations_is_1():
54
54
feature1 = rs .rand (100 )
55
55
56
56
# Run
57
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 1 )
57
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 1 )
58
58
59
59
# Validate
60
60
assert len (res ) == 2
@@ -78,7 +78,7 @@ def test_cm_basic_pvalue_n_permutations_is_10():
78
78
feature1 = rs .rand (100 )
79
79
80
80
# Run
81
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 10 )
81
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 10 )
82
82
83
83
# Validate
84
84
assert len (res ) == 2
@@ -101,7 +101,7 @@ def test_cm_linear_pvalue_n_permutations_10():
101
101
feature1 = feature0 * 5.0
102
102
103
103
# Run
104
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 10 )
104
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 10 )
105
105
106
106
# Validate
107
107
assert len (res ) == 2
@@ -124,7 +124,7 @@ def test_cm_linear_pvalue_n_permutations_100():
124
124
feature1 = feature0 * 5.0
125
125
126
126
# Run
127
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 100 )
127
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 100 )
128
128
129
129
# Validate
130
130
assert len (res ) == 2
@@ -147,7 +147,7 @@ def test_cm_quadratic_pvalue():
147
147
feature1 = np .power (feature0 , 2.0 )
148
148
149
149
# Run
150
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 100 )
150
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 100 )
151
151
152
152
# Validate
153
153
assert len (res ) == 2
@@ -170,7 +170,7 @@ def test_cm_quadratic_noisy_pvalue_with_random_state():
170
170
feature1 = np .power (feature0 , 2.0 ) + (2.0 * rs .rand (feature0 .shape [0 ]))
171
171
172
172
# Run
173
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 100 , random_state = 2 )
173
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 100 , random_state = 2 )
174
174
175
175
# Validate
176
176
assert len (res ) == 2
@@ -196,7 +196,7 @@ def test_cm_one_feature_with_all_same_values_pvalue():
196
196
feature1 = np .array ([5 ] * feature0 .shape [0 ])
197
197
198
198
# Run
199
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 100 )
199
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 100 )
200
200
201
201
# Validate
202
202
assert len (res ) == 2
@@ -222,7 +222,7 @@ def test_cm_single_argument_is_matrix():
222
222
input_data = np .array ([feature0 , feature1 , feature2 ])
223
223
224
224
# Run
225
- res = ccc (input_data , pvalue_n_permutations = 100 , random_state = 1 )
225
+ res = ccc (input_data , pvalue_n_perms = 100 , random_state = 1 )
226
226
227
227
# Validate
228
228
assert len (res ) == 2
@@ -252,11 +252,11 @@ def test_cm_large_n_objects_pvalue_computation_is_parallelized():
252
252
253
253
# Run
254
254
start_time = time .time ()
255
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 50 , n_jobs = 1 )
255
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 50 , n_jobs = 1 )
256
256
elapsed_time_single_thread = time .time () - start_time
257
257
258
258
start_time = time .time ()
259
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 50 , n_jobs = 2 )
259
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 50 , n_jobs = 2 )
260
260
elapsed_time_multi_thread = time .time () - start_time
261
261
262
262
# Validate
@@ -273,11 +273,11 @@ def test_cm_medium_n_objects_with_many_pvalue_computation_is_parallelized():
273
273
274
274
# Run
275
275
start_time = time .time ()
276
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 1000 , n_jobs = 1 )
276
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 1000 , n_jobs = 1 )
277
277
elapsed_time_single_thread = time .time () - start_time
278
278
279
279
start_time = time .time ()
280
- res = ccc (feature0 , feature1 , pvalue_n_permutations = 1000 , n_jobs_permutations = 2 )
280
+ res = ccc (feature0 , feature1 , pvalue_n_perms = 1000 , pvalue_n_jobs = 2 )
281
281
elapsed_time_multi_thread = time .time () - start_time
282
282
283
283
# Validate
@@ -298,7 +298,7 @@ def test_cm_return_parts_quadratic_pvalue():
298
298
feature1 ,
299
299
internal_n_clusters = [2 , 3 ],
300
300
return_parts = True ,
301
- pvalue_n_permutations = 10 ,
301
+ pvalue_n_perms = 10 ,
302
302
)
303
303
304
304
# Validate
@@ -350,7 +350,7 @@ def test_cm_numerical_and_categorical_features_perfect_relationship_pvalue():
350
350
res = ccc (
351
351
numerical_feature0 ,
352
352
categorical_feature1 ,
353
- pvalue_n_permutations = 100 ,
353
+ pvalue_n_perms = 100 ,
354
354
)
355
355
356
356
# Validate
@@ -366,9 +366,7 @@ def test_cm_numerical_and_categorical_features_perfect_relationship_pvalue():
366
366
assert pvalue == (0 + 1 ) / (100 + 1 )
367
367
368
368
# Run with flipped variables (symmetry)
369
- assert (
370
- ccc (categorical_feature1 , numerical_feature0 , pvalue_n_permutations = 100 ) == res
371
- )
369
+ assert ccc (categorical_feature1 , numerical_feature0 , pvalue_n_perms = 100 ) == res
372
370
373
371
374
372
def test_cm_numerical_and_categorical_features_weakly_relationship_pvalue ():
@@ -397,7 +395,7 @@ def test_cm_numerical_and_categorical_features_weakly_relationship_pvalue():
397
395
res = ccc (
398
396
categorical_feature1 ,
399
397
numerical_feature0 ,
400
- pvalue_n_permutations = 100 ,
398
+ pvalue_n_perms = 100 ,
401
399
random_state = 1 ,
402
400
)
403
401
@@ -418,7 +416,7 @@ def test_cm_numerical_and_categorical_features_weakly_relationship_pvalue():
418
416
ccc (
419
417
numerical_feature0 ,
420
418
categorical_feature1 ,
421
- pvalue_n_permutations = 100 ,
419
+ pvalue_n_perms = 100 ,
422
420
random_state = 1 ,
423
421
)
424
422
== res
@@ -442,7 +440,7 @@ def test_cm_numerical_and_categorical_features_a_single_categorical_value():
442
440
res = ccc (
443
441
numerical_feature0 ,
444
442
categorical_feature1 ,
445
- pvalue_n_permutations = 100 ,
443
+ pvalue_n_perms = 100 ,
446
444
random_state = 1 ,
447
445
)
448
446
@@ -463,7 +461,7 @@ def test_cm_numerical_and_categorical_features_a_single_categorical_value():
463
461
ccc (
464
462
categorical_feature1 ,
465
463
numerical_feature0 ,
466
- pvalue_n_permutations = 100 ,
464
+ pvalue_n_perms = 100 ,
467
465
random_state = 1 ,
468
466
)
469
467
== res
@@ -478,7 +476,7 @@ def test_cm_with_pandas_dataframe_several_features():
478
476
data = pd .DataFrame (rs .rand (20 , 50 ))
479
477
480
478
# Run
481
- res = ccc (data , internal_n_clusters = 3 , pvalue_n_permutations = 10 , random_state = 1 )
479
+ res = ccc (data , internal_n_clusters = 3 , pvalue_n_perms = 10 , random_state = 1 )
482
480
483
481
# Validate
484
482
assert len (res ) == 2
0 commit comments