|
26 | 26 | from sklearn.metrics import accuracy_score
|
27 | 27 | from sklearn.metrics import average_precision_score
|
28 | 28 | from sklearn.metrics import confusion_matrix
|
| 29 | +from sklearn.metrics import multilabel_confusion_matrix |
29 | 30 | from sklearn.metrics import coverage_error
|
30 | 31 | from sklearn.metrics import explained_variance_score
|
31 | 32 | from sklearn.metrics import f1_score
|
|
98 | 99 | "accuracy_score": accuracy_score,
|
99 | 100 | "unnormalized_accuracy_score": partial(accuracy_score, normalize=False),
|
100 | 101 | "confusion_matrix": confusion_matrix,
|
| 102 | + "multilabel_confusion_matrix": multilabel_confusion_matrix, |
101 | 103 | "hamming_loss": hamming_loss,
|
102 | 104 |
|
103 | 105 | "jaccard_similarity_score": jaccard_similarity_score,
|
|
185 | 187 | METRIC_UNDEFINED_MULTICLASS = [
|
186 | 188 | "samples_f0.5_score", "samples_f1_score", "samples_f2_score",
|
187 | 189 | "samples_precision_score", "samples_recall_score",
|
| 190 | + # FIXME to be moved to METRIC_UNDEFINED_BINARY after merge of #4115 |
| 191 | + # this is needed to run some basic tests on multilabel_confusion_matrix. |
| 192 | + "multilabel_confusion_matrix", |
188 | 193 |
|
189 | 194 | # Those metrics don't support multiclass outputs
|
190 | 195 | "average_precision_score", "weighted_average_precision_score",
|
|
331 | 336 | # No Sample weight support
|
332 | 337 | METRICS_WITHOUT_SAMPLE_WEIGHT = [
|
333 | 338 | "confusion_matrix",
|
| 339 | + "multilabel_confusion_matrix", |
334 | 340 | "hamming_loss",
|
335 | 341 | "matthews_corrcoef_score",
|
336 | 342 | "median_absolute_error",
|
|
0 commit comments