Skip to content

Commit 93f0216

Browse files
NicolasHugglemaitreamueller
authored
DOC minor update to classification_report docstring (scikit-learn#16899)
Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Andreas Mueller <[email protected]>
1 parent 31f606a commit 93f0216

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/metrics/_classification.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,8 @@ def classification_report(y_true, y_pred, *, labels=None, target_names=None,
18851885
per label), and sample average (only for multilabel classification).
18861886
Micro average (averaging the total true positives, false negatives and
18871887
false positives) is only shown for multi-label or multi-class
1888-
with a subset of classes, because it corresponds to accuracy otherwise.
1888+
with a subset of classes, because it corresponds to accuracy
1889+
otherwise and would be the same for all metrics.
18891890
See also :func:`precision_recall_fscore_support` for more details
18901891
on averages.
18911892
@@ -1932,12 +1933,12 @@ class 2 1.00 0.67 0.80 3
19321933

19331934
y_type, y_true, y_pred = _check_targets(y_true, y_pred)
19341935

1935-
labels_given = True
19361936
if labels is None:
19371937
labels = unique_labels(y_true, y_pred)
19381938
labels_given = False
19391939
else:
19401940
labels = np.asarray(labels)
1941+
labels_given = True
19411942

19421943
# labelled micro average
19431944
micro_is_accuracy = ((y_type == 'multiclass' or y_type == 'binary') and

0 commit comments

Comments
 (0)