Skip to content

Commit dc4255f

Browse files
neerajgangwarlesteve
authored andcommitted
[MRG+1] Add a note in coverage_error doc to highlight the difference from original coverage formula (scikit-learn#7915)
1 parent 5a08856 commit dc4255f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

doc/modules/model_evaluation.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,12 @@ are predicted. This is useful if you want to know how many top-scored-labels
11331133
you have to predict in average without missing any true one. The best value
11341134
of this metrics is thus the average number of true labels.
11351135

1136+
.. note::
1137+
1138+
Our implementation's score is 1 greater than the one given in Tsoumakas
1139+
et al., 2010. This extends it to handle the degenerate case in which an
1140+
instance has 0 true labels.
1141+
11361142
Formally, given a binary indicator matrix of the ground truth labels
11371143
:math:`y \in \left\{0, 1\right\}^{n_\text{samples} \times n_\text{labels}}` and the
11381144
score associated with each label
@@ -1236,6 +1242,12 @@ Here is a small example of usage of this function::
12361242
>>> label_ranking_loss(y_true, y_score)
12371243
0.0
12381244

1245+
1246+
.. topic:: References:
1247+
1248+
* Tsoumakas, G., Katakis, I., & Vlahavas, I. (2010). Mining multi-label data. In
1249+
Data mining and knowledge discovery handbook (pp. 667-685). Springer US.
1250+
12391251
.. _regression_metrics:
12401252

12411253
Regression metrics

sklearn/metrics/ranking.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,10 @@ def coverage_error(y_true, y_score, sample_weight=None):
633633
Ties in ``y_scores`` are broken by giving maximal rank that would have
634634
been assigned to all tied values.
635635
636+
Note: Our implementation's score is 1 greater than the one given in
637+
Tsoumakas et al., 2010. This extends it to handle the degenerate case
638+
in which an instance has 0 true labels.
639+
636640
Read more in the :ref:`User Guide <coverage_error>`.
637641
638642
Parameters

0 commit comments

Comments
 (0)