Distinguishing whether a thing was generated by distribution A or B.

## Multi-label

Precision/Recall and f-scores all work for multi-label classification, although this exacerbates bad qualities in unbalanced classes.

There are also surprising models here. Read et al. (2021) discusses how to create multi-class classifiers by stacking layers of binary classifiers and using each as a feature input to the next, which is an elegant solution IMO.

## Relative distributions

Why characterise a difference in distributions by a summary statistic? Just have an object which is a relative distribution.

## Probabilistic classification: Calibration

In the context of binary classification, calibration refers to the process of transforming the output scores from a binary classifier to class probabilities. If we think of the classifier as a “black box” that transforms input data into a score, we can think of calibration as a post-processing step that converts the score into a probability of the observation belonging to class 1.

The scores from some classifiers can already be interpreted as probabilities (e.g. logistic regression), while the scores from some classifiers require an additional calibration step before they can be interpreted as such (e.g. support vector machines).

He recommends the tutorial Huang et al. (2020) and associated github.

## Classification loss zoo

Surprisingly subtle. ROC, AUC, precision/recall, confusion…

One of the less abstruse summaries of these is the scikit-learn classifier loss page, which includes both formulae and verbal descriptions. The Pirates guide to various scores provides an easy introduction.

### Matthews correlation coefficient

Due to Matthews (1975). This is the first choice for seamlessly handling multi-label problems within a single algorithm since its behaviour is reasonable for 2 class or multi class, balanced or unbalanced, and it’s computationally cheap. Unless you have a vastly different importance for your classes, this is a good default.

However, it is not differentiable with respect to classification certainties, so you can’t use it as, e.g., a target loss in neural nets; Therefore you use surrogate measures which are differentiable and use this to track your progress.

#### 2-class case

Take your \(2 \times 2\). confusion matrix of true positive, false positives etc.

\[ {\text{MCC}}={\frac {TP\times TN-FP\times FN}{{\sqrt {(TP+FP)(TP+FN)(TN+FP)(TN+FN)}}}} \]

\[ |{\text{MCC}}|={\sqrt {{\frac {\chi ^{2}}{n}}}} \]

#### Multiclass case

Take your \(K \times K\) confusion matrix \(C\), then

\[ {\displaystyle {\text{MCC}}={\frac {\sum _{k}\sum _{l}\sum _{m}C_{kk}C_{lm}-C_{kl}C_{mk}}{{\sqrt {\sum _{k}(\sum _{l}C_{kl})(\sum _{k'|k'\neq k}\sum _{l'}C_{k'l'})}}{\sqrt {\sum _{k}(\sum _{l}C_{lk})(\sum _{k'|k'\neq k}\sum _{l'}C_{l'k'})}}}}} \]

### ROC/AUC

Receiver Operator Characteristic/Area Under Curve. Supposedly dates back to radar operators in WWII. The graph of the false versus true positive rate as the criterion changes. Matthews (1975) talk about the AUC for radiology; Supposedly Spackman (1989) introduced it to machine learning, but I haven’t read the article in question. Allows you to trade off importance of false positive/false negatives.

### Cross entropy

I’d better write down form for this, since most ML toolkits are curiously shy about it.

Let \(x\) be the estimated probability and \(z\) be the supervised class label. Then the binary cross entropy loss is

\[ \ell(x,z) = -z\log(x) - (1-z)\log(1-x) \]

If \(y=\operatorname{logit}(x)\) is not a probability but a logit, then the numerically stable version is

\[ \ell(y,z) = \max\{y,0\} - y + \log(1+\exp(-|x|)) \]

### f-measure et al

🏗

## Philosophical connection to semantics

Since semantics is what humans call classifiers.

## Multi-label

Precision/Recall and f-scores all work for multi-label classification, although they have bad qualities in unbalanced classes.

## Unbalanced class problems

🏗

## Calibration

In the context of binary classification, calibration refers to the process of transforming the output scores from a binary classifier to class probabilities. If we think of the classifier as a “black box” that transforms input data into a score, we can think of calibration as a post-processing step that converts the score into a probability of the observation belonging to class 1.

The scores from some classifiers can already be interpreted as probabilities (e.g. logistic regression), while the scores from some classifiers require an additional calibration step before they can be interpreted as such (e.g. support vector machines).

He recommends the tutorial Huang et al. (2020) and associated github.

See Ben Recht on the dangers of logistic regression for odds ratios There are some philosophical questions there, and also some sledging of logistic regression bad habits.

## Bayes

The Gumbel trick is ingenious for sampling from things that look like categorical distributions and simplices.

## References

*Machine Learning and the Physical Sciences Workshop at the 33rd Conference on Neural Information Processing Systems (NeurIPS)*, 6.

*Proceedings of the 28th International Conference on Machine Learning (ICML-11)*, 657–64. http://www.icml-2011.org/papers/385_icmlpaper.pdf.

*Journal of the American Statistical Association*102 (477): 359–78. https://doi.org/10.1198/016214506000001437.

*Computational Biology and Chemistry*28 (5-6): 367–74. https://doi.org/10.1016/j.compbiolchem.2004.09.006.

*Machine Learning*77 (1): 103–23. https://doi.org/10.1007/s10994-009-5119-5.

*Radiology*148 (3): 839–43. https://doi.org/10.1148/radiology.148.3.6878708.

*Journal of the American Medical Informatics Association : JAMIA*27 (4): 621–33. https://doi.org/10.1093/jamia/ocz228.

*arXiv:1612.01414 [Cs, Stat]*, December. http://arxiv.org/abs/1612.01414.

*The Annals of Statistics*49 (1): 411–34. https://doi.org/10.1214/20-AOS1962.

*Global Ecology and Biogeography*17 (2): 145–51. https://doi.org/10.1111/j.1466-8238.2007.00358.x.

*Biochimica Et Biophysica Acta (BBA) - Protein Structure*405 (2): 442–51. https://doi.org/10.1016/0005-2795(75)90109-9.

*Journal of Machine Learning Research*17 (195): 1–102. http://jmlr.org/papers/v17/14-265.html.

*arXiv:1607.00360 [Cs, Stat]*, July. http://arxiv.org/abs/1607.00360.

*Journal of Artificial Intelligence Research*70 (February): 683–718. https://doi.org/10.1613/jair.1.12376.

*Journal of Machine Learning Research*12 (Mar): 731–817. http://www.jmlr.org/papers/v12/reid11a.html.

*Machine Learning and the Physical Sciences Workshop at the 33rd Conference on Neural Information Processing Systems (NeurIPS)*, 6.

*Proceedings of the Sixth International Workshop on Machine Learning*, edited by Alberto Maria Segre, 160–63. San Francisco (CA): Morgan Kaufmann. https://doi.org/10.1016/B978-1-55860-036-2.50047-3.

## No comments yet. Why not leave one?