Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c71a7f

Browse files
embanderaglemaitre
authored andcommitted
DOC Ensures that zero_one_loss passes numpydoc validation (#21450)
1 parent db6d81e commit 8c71a7f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
"sklearn.metrics._classification.precision_recall_fscore_support",
107107
"sklearn.metrics._classification.precision_score",
108108
"sklearn.metrics._classification.recall_score",
109-
"sklearn.metrics._classification.zero_one_loss",
110109
"sklearn.metrics._plot.confusion_matrix.plot_confusion_matrix",
111110
"sklearn.metrics._plot.det_curve.plot_det_curve",
112111
"sklearn.metrics._plot.precision_recall_curve.plot_precision_recall_curve",

sklearn/metrics/_classification.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,16 +945,21 @@ def zero_one_loss(y_true, y_pred, *, normalize=True, sample_weight=None):
945945
If ``normalize == True``, return the fraction of misclassifications
946946
(float), else it returns the number of misclassifications (int).
947947
948+
See Also
949+
--------
950+
accuracy_score : Compute the accuracy score. By default, the function will
951+
return the fraction of correct predictions divided by the total number
952+
of predictions.
953+
hamming_loss : Compute the average Hamming loss or Hamming distance between
954+
two sets of samples.
955+
jaccard_score : Compute the Jaccard similarity coefficient score.
956+
948957
Notes
949958
-----
950959
In multilabel classification, the zero_one_loss function corresponds to
951960
the subset zero-one loss: for each sample, the entire set of labels must be
952961
correctly predicted, otherwise the loss for that sample is equal to one.
953962
954-
See Also
955-
--------
956-
accuracy_score, hamming_loss, jaccard_score
957-
958963
Examples
959964
--------
960965
>>> from sklearn.metrics import zero_one_loss

0 commit comments

Comments
 (0)