Skip to content

Commit b0449b6

Browse files
committed
DOC explain labels parameter to confusion_matrix
1 parent ecf135a commit b0449b6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/metrics/metrics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,11 @@ def confusion_matrix(y_true, y_pred, labels=None):
676676
y_pred : array, shape = [n_samples]
677677
Estimated targets as returned by a classifier.
678678
679-
labels : array, shape = [n_classes]
680-
List of all labels occurring in the dataset.
679+
labels : array, shape = [n_classes], optional
680+
List of labels to index the matrix. This may be used to reorder
681+
or select a subset of labels.
681682
If none is given, those that appear at least once
682-
in ``y_true`` or ``y_pred`` are used.
683+
in ``y_true`` or ``y_pred`` are used in sorted order.
683684
684685
Returns
685686
-------

0 commit comments

Comments
 (0)