From 0b339cfa6389ce1c688348126d6a2c80aa85f9d0 Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Tue, 9 Jul 2013 11:16:47 +1000 Subject: [PATCH] FIX error message for mixed metric input (for #2137) --- sklearn/metrics/metrics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/metrics/metrics.py b/sklearn/metrics/metrics.py index c23c8c3410b06..c4408c99e0ade 100644 --- a/sklearn/metrics/metrics.py +++ b/sklearn/metrics/metrics.py @@ -165,14 +165,14 @@ def _check_clf_targets(y_true, y_pred): if type_true.startswith('multilabel'): if not type_pred.startswith('multilabel'): - raise ValueError("Can't handle mix of multilabel and multiclass " - "targets") + raise ValueError("Can't handle mix of multilabel and {0} " + "targets".format(type_pred)) if type_true != type_pred: raise ValueError("Can't handle mix of multilabel formats (label " "indicator matrix and sequence of sequences)") elif type_pred.startswith('multilabel'): - raise ValueError("Can't handle mix of multilabel and multiclass " - "targets") + raise ValueError("Can't handle mix of multilabel and {0} " + "targets".format(type_true)) elif (type_pred in ('multiclass', 'binary') and type_true in ('multiclass', 'binary')):