Skip to content

Commit 56afa3e

Browse files
ndawearjoly
authored andcommitted
weighted metrics tests fixes
1 parent b4df4cd commit 56afa3e

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

sklearn/metrics/tests/test_metrics.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,14 @@
313313
"accuracy_score", "unnormalized_accuracy_score",
314314
"zero_one_loss", "unnormalized_zero_one_loss",
315315

316-
"precision_score", "weighted_precision_score",
317-
318-
"average_precision_score", "weighted_average_precision_score",
319-
316+
"precision_score", "average_precision_score",
320317
"f1_score", "f2_score", "f0.5_score",
321-
"weighted_f0.5_score", "weighted_f1_score", "weighted_f2_score",
318+
"recall_score", "roc_auc_score",
322319

323-
"recall_score", "weighted_recall_score",
324-
325-
"roc_auc_score", "weighted_roc_auc",
320+
"weighted_precision_score",
321+
"weighted_average_precision_score",
322+
"weighted_f0.5_score", "weighted_f1_score", "weighted_f2_score",
323+
"weighted_recall_score", "weighted_roc_auc",
326324

327325
"explained_variance_score",
328326
"mean_squared_error",
@@ -335,12 +333,11 @@
335333
"accuracy_score", "unnormalized_accuracy_score",
336334
"zero_one_loss", "unnormalized_zero_one_loss",
337335

338-
"precision_score", "weighted_precision_score",
339-
336+
"precision_score", "recall_score",
340337
"f1_score", "f2_score", "f0.5_score",
341-
"weighted_f0.5_score", "weighted_f1_score", "weighted_f2_score",
342338

343-
"recall_score", "weighted_recall_score",
339+
"weighted_precision_score", "weighted_recall_score",
340+
"weighted_f0.5_score", "weighted_f1_score", "weighted_f2_score",
344341

345342
"micro_f0.5_score", "micro_f1_score", "micro_f2_score",
346343
"micro_precision_score", "micro_recall_score",
@@ -357,9 +354,11 @@
357354
"weighted_average_precision_score",
358355
"micro_average_precision_score",
359356
"macro_average_precision_score",
360-
#"samples_average_precision_score",
361-
#"samples_roc_auc",
357+
"samples_average_precision_score",
358+
"roc_auc_score",
362359
"micro_roc_auc",
360+
"macro_roc_auc",
361+
"samples_roc_auc",
363362
]
364363

365364
# Regression metrics that support multioutput and weighted samples
@@ -2657,11 +2656,11 @@ def test_sample_weight_invariance():
26572656

26582657
# multilabel indicator
26592658
_, y1 = make_multilabel_classification(
2660-
n_features=1, n_classes=3,
2659+
n_features=1, n_classes=6,
26612660
random_state=0, n_samples=10,
26622661
return_indicator=True)
26632662
_, y2 = make_multilabel_classification(
2664-
n_features=1, n_classes=3,
2663+
n_features=1, n_classes=6,
26652664
random_state=1, n_samples=10,
26662665
return_indicator=True)
26672666
for name in MULTILABEL_INDICATOR_METRICS_WITH_SAMPLE_WEIGHT:

0 commit comments

Comments
 (0)