@@ -68,11 +68,14 @@ def test_check_target_type_ova(target, output_target, is_ova):
68
68
assert binarize_target == is_ova
69
69
70
70
71
- def test_check_sampling_strategy_warning ():
72
- msg = "dict for cleaning methods is not supported"
71
+ @pytest .mark .parametrize (
72
+ "sampling_method" , ["clean-sampling" , "preprocess-sampling" ]
73
+ )
74
+ def test_check_sampling_strategy_warning (sampling_method ):
75
+ msg = "dict for cleaning or preprocess methods is not supported"
73
76
with pytest .raises (ValueError , match = msg ):
74
77
check_sampling_strategy (
75
- {1 : 0 , 2 : 0 , 3 : 0 }, multiclass_target , "clean-sampling"
78
+ {1 : 0 , 2 : 0 , 3 : 0 }, multiclass_target , sampling_method
76
79
)
77
80
78
81
@@ -83,7 +86,13 @@ def test_check_sampling_strategy_warning():
83
86
0.5 ,
84
87
binary_target ,
85
88
"clean-sampling" ,
86
- "'clean-sampling' methods do let the user specify the sampling ratio" , # noqa
89
+ "-sampling' methods do not let the user specify the sampling ratio" ,
90
+ ),
91
+ (
92
+ 0.5 ,
93
+ binary_target ,
94
+ "preprocess-sampling" ,
95
+ "-sampling' methods do not let the user specify the sampling ratio" ,
87
96
),
88
97
(
89
98
0.1 ,
@@ -122,6 +131,7 @@ def test_check_sampling_strategy_error():
122
131
[
123
132
("majority" , "over-sampling" , "over-sampler" ),
124
133
("minority" , "under-sampling" , "under-sampler" ),
134
+ ("minority" , "clean-sampling" , "under-sampler" ),
125
135
],
126
136
)
127
137
def test_check_sampling_strategy_error_wrong_string (
0 commit comments