File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 179179# When you add a new metric or functionality, check if a general test
180180# is already written.
181181
182- # Metric undefine with "binary" or "multiclass" input
182+ # Metric undefined with "binary" or "multiclass" input
183183METRIC_UNDEFINED_MULTICLASS = [
184184 "samples_f0.5_score" , "samples_f1_score" , "samples_f2_score" ,
185185 "samples_precision_score" , "samples_recall_score" ,
@@ -1377,6 +1377,8 @@ def test_format_invariance_with_1d_vectors():
13771377 y2_row = np .reshape (y2_1d , (1 , - 1 ))
13781378
13791379 for name , metric in ALL_METRICS .items ():
1380+ if name in METRIC_UNDEFINED_MULTICLASS :
1381+ continue
13801382
13811383 measure = metric (y1 , y2 )
13821384
@@ -1447,8 +1449,7 @@ def test_invariance_string_vs_numbers_labels():
14471449 labels_str = ["eggs" , "spam" ]
14481450
14491451 for name , metric in CLASSIFICATION_METRICS .items ():
1450- if isinstance (metric , partial ) and 'labels' in metric .keywords :
1451- # don't test metric if "labels" are already set
1452+ if name in METRIC_UNDEFINED_MULTICLASS :
14521453 continue
14531454
14541455 measure_with_number = metric (y1 , y2 )
You can’t perform that action at this time.
0 commit comments