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

Skip to content

Commit 653de6c

Browse files
maskani-mohamueller
authored andcommitted
Balanced accuracy doc - 2 (#10040)
* Add references for multiclass balanced-accuracy * Add precision not implemented * Add another reference * Adjust note * Add succint definitions * Add macro-average recall implementation * Add class balance accuracy reference and definition * Fix typo * Add precision/recall comparison * Fix typo * Make descriptions less verbose and merge definitions * Add reference for averaging accuracy * Move macro-average recall example to corresponding section
1 parent b4231cc commit 653de6c

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

doc/modules/model_evaluation.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,20 +464,19 @@ given binary ``y_true`` and ``y_pred``:
464464
There is no clear consensus on the definition of a balanced accuracy for the
465465
multiclass setting. Here are some definitions that can be found in the literature:
466466

467-
* Normalized class-wise accuracy average as described in [Guyon2015]_: for multi-class
468-
classification problem, each sample is assigned the class with maximum prediction value.
469-
The predictions are then binarized to compute the accuracy of each class on a
470-
one-vs-rest fashion. The balanced accuracy is obtained by averaging the individual
471-
accuracies over all classes and then normalized by the expected value of balanced
472-
accuracy for random predictions (:math:`0.5` for binary classification, :math:`1/C`
473-
for C-class classification problem).
474-
* Macro-average recall as described in [Mosley2013]_ and [Kelleher2015]_: the recall
475-
for each class is computed independently and the average is taken over all classes.
467+
* Macro-average recall as described in [Mosley2013]_, [Kelleher2015]_ and [Guyon2015]_:
468+
the recall for each class is computed independently and the average is taken over all classes.
469+
In [Guyon2015]_, the macro-average recall is then adjusted to ensure that random predictions
470+
have a score of :math:`0` while perfect predictions have a score of :math:`1`.
471+
One can compute the macro-average recall using ``recall_score(average="macro")`` in :func:`recall_score`.
472+
* Class balanced accuracy as described in [Mosley2013]_: the minimum between the precision
473+
and the recall for each class is computed. Those values are then averaged over the total
474+
number of classes to get the balanced accuracy.
475+
* Balanced Accuracy as described in [Urbanowicz2015]_: the average of sensitivity and selectivity
476+
is computed for each class and then averaged over total number of classes.
476477

477478
Note that none of these different definitions are currently implemented within
478-
the :func:`balanced_accuracy_score` function. However, the macro-averaged recall
479-
is implemented in :func:`sklearn.metrics.recall_score`: set ``average`` parameter
480-
to ``"macro"``.
479+
the :func:`balanced_accuracy_score` function.
481480

482481
.. topic:: References:
483482

@@ -492,6 +491,8 @@ given binary ``y_true`` and ``y_pred``:
492491
Machine Learning for Predictive Data Analytics: Algorithms, Worked Examples,
493492
and Case Studies <https://mitpress.mit.edu/books/fundamentals-machine-learning-predictive-data-analytics>`_,
494493
2015.
494+
.. [Urbanowicz2015] Urbanowicz R.J., Moore, J.H. `ExSTraCS 2.0: description and evaluation of a scalable learning
495+
classifier system < https://doi.org/10.1007/s12065-015-0128-8>`_, Evol. Intel. (2015) 8: 89.
495496
496497
.. _cohen_kappa:
497498

0 commit comments

Comments
 (0)