ATLAS NOVA My AtlasVelocer ↗

Technology · Machine learning

Supervised learning

Machine learning branch

Supervised learning is the branch of machine learning in which a model is built from examples whose correct answers are already known.

Each example pairs an input, such as a set of measurements, with a label: the answer the model should produce for that input. The task is to learn a mapping from inputs to labels that will also hold for inputs the model has never seen. In the binary case the label takes one of two values, and the two groups are usually called the positive and the negative class; a clinical dataset might label each patient as sick or healthy, or a tumor as low or high grade.⁠[1] Nothing about the method requires two classes, though the binary case is a common setting.⁠[1]

Key facts
0.994Best algorithm's AUC on slide-level metastasis classification, CAMELYON16 (Ehteshami Bejnordi et al., 2017)⁠[2]
0.936Deep learning system AUC for referable diabetic retinopathy, validation set (Ting et al., 2017)⁠[3]
88.6Neural network accuracy for diabetes prediction on Pima dataset (Khanam and Foo, 2021)⁠[4]
97Negative predictive value for pathologic complete response, subtype model (Parker et al., 2009)⁠[5]

Overview

Supervised learning

The learning happens in two stages. During training, the model is shown the labeled examples and adjusts itself so that its outputs come closer to the known labels. During prediction, the trained model is given a new input with no label and produces its best guess. The distinction matters because the goal is never to reproduce the training answers; a model that only memorized them would be useless on new patients or new images. What is wanted is a rule that generalizes, and the whole practice of supervised learning is organized around that aim.

Machine learning algorithms, including supervised ones, have been applied to automated text categorization, network intrusion detection, junk e-mail filtering, credit card fraud detection, customer purchase behavior, manufacturing optimization and disease modeling. Machine learning algorithms generally, and supervised ones in particular, have been applied to automated text categorization, network intrusion detection, junk e-mail filtering, credit card fraud detection, customer purchase behavior, manufacturing optimization and disease modeling. In the supervised variant, a prediction model is developed by learning from a dataset where the label is known, and the outcome of unlabeled examples can then be predicted.⁠[6] The appeal is that the computer is not given rules to follow; it is given cases and their answers, and it works out the relationship itself.

That relationship can be complex. Deep learning, the multi-layer branch of machine learning, does not require any human-designed rules to operate; it uses a large amount of data to map a given input to specific labels. The same source notes that although machine learning is slowly moving toward semi-supervised and unsupervised learning to manage practical data without manual labeling, many current deep-learning models still rely on supervised learning.⁠[7]

Two difficulties follow directly. The first is evaluation. A classifier's output has to be scored, and the obvious score, the share of examples it gets right, can mislead badly when one class vastly outnumbers the other; a model that simply guesses the common class every time can look accurate while being useless for the rare one. Choosing a measure is therefore part of the method, not an afterthought, and the question of which measure to trust has no settled answer.⁠[1]

The second difficulty is the labels themselves. Strong supervision, meaning fully correct labels for every example, is expensive to obtain, and in many tasks it is difficult to get at all because the labeling process costs so much.⁠[8] A model is only as good as the answers it was taught from, and those answers must be gathered by hand, one case at a time.

Supervised learning therefore sits between a simple promise and a real constraint. The promise is a program that learns from examples rather than instructions. The constraint is that the examples must be labeled, scored and trusted, and each of those steps brings its own problems. Later parts of this chapter take up how the mapping is actually fitted, which algorithm families are used, how classifiers are judged fairly, and what is done when labels are scarce or imperfect.

Supervised learning learns a mapping from inputs to known labels, then applies it to unseen inputs; its two persistent costs are labeling data and judging the result honestly.

History

From hand-built features to learned ones

Before a model can learn anything, its input has to be described in a form it can use. For a long time that description was the researcher's job. Feature engineering is the construction of features from raw data: the measurable quantities, computed from the raw record, on which a classifier bases its decision. It is a field-specific craft that frequently requires sizable human effort, and it has driven a great deal of machine learning research. In computer vision, for instance, several families of hand-designed descriptors were introduced and compared, among them the histogram of oriented gradients (HOG), the scale-invariant feature transform (SIFT) and the bag of words (BoW).⁠[7] Each of these turns an image into a vector of numbers chosen by a person who knows what visual structure tends to matter.

A side-by-side figure with a photo of a smiling woman in a magenta jacket holding a grey folder labeled "Koalitionsvertrag 2018–2021" on the left, and on the right a black-and-white HOG (histogram of oriented gradients) rendering of the same image made of short white edge-orientation strokes.
A side-by-side figure with a photo of a smiling woman in a magenta jacket holding a grey folder labeled "Koalitionsvertrag 2018–2021" on the left, and on the right a black-and-white HOG (histogram of oriented gradients) rendering of the same image made of short white edge-orientation strokes. View full-size image.HOG scikit-image AngelaMerkel by MTheiler. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

As soon as a novel feature was introduced and found to perform well, it became a new research direction pursued over multiple decades. Feature engineering is extremely field-specific and frequently requires sizable human effort. The quality of the input representation mattered enormously: a suitable data representation gives improved performance compared with a poor one, which is why feature engineering absorbed so much of the field's attention.⁠[7]

Deep learning changed where that work happens. Its algorithms extract features automatically, which lets researchers obtain discriminative features with the smallest possible amount of human effort and field knowledge. The mechanism is a multi-layer architecture in which the first layers extract low-level features and the last layers extract high-level features, so that the representation is built up in stages inside the network rather than supplied from outside. The arrangement was originally inspired by the way core sensory regions of the brain process a scene, taking raw input and producing a classified object as output.⁠[7]

The practical consequence is that learning and classification can be achieved in a single shot, where conventional machine learning needs a sequence of steps: pre-processing, feature extraction, wise feature selection, learning and classification. That matters because feature selection has a strong effect on performance, and a biased selection may lead to incorrect discrimination between classes.⁠[7] When the features are learned rather than picked, that particular failure mode is no longer sitting at the front of the pipeline. Deep learning is currently one of the most prominent research trends in machine learning, and the convolutional neural network is one of the most popular and used of deep learning networks.⁠[7] How such a network is actually fitted to labeled data, and how the labels and losses enter, is covered later.

How it works

Labels, loss functions and the training loop

The label is the whole basis of the method, so it is worth being precise about what it is. Annotated ground truth means the correct answer for each training example, recorded by a person rather than produced by the model itself. Supervised learning is defined by the use of loss functions that align predictions with this manually annotated ground truth.⁠[9] The phrase describes a relationship, not a file format: whatever the model outputs is compared against the recorded answer, and the size of the disagreement is what the training process works on.

A central training loop connects a labeled example, model, loss and parameter update, beside numbered steps and a worked scalar calculation.
The training loop compares predictions with labels and updates model parameters. A scalar example shows squared loss falling from 4 to 0.16. View full-size image.Supervised Learning Training Loop by Atlas Nova. Illustration generated with AI for this article and checked against its text.

A loss function turns that comparison into a single number. For each example the model produces a prediction, the prediction is set against the label, and the loss measures how far apart they are. Training is then a matter of adjusting the model's internal settings so that the loss comes out smaller. Because the loss is a number, it can be reduced by ordinary numerical methods, and the model improves by being nudged in the direction that lowers it. Nothing in this loop requires the model to understand the task; it requires only that the loss respond to changes in the settings, so that a wrong answer can be made less wrong.

The loop repeats over many examples, and the settings settle into values that produce good answers across the training set. This is where the earlier distinction between training and prediction earns its keep. A model with enough internal freedom can drive the training loss close to zero by memorizing the particular examples it was shown, which leaves it unprepared for anything new. Deep neural networks are highly parametric models with very high variance that can easily model their training data, and fitting the training data is surprisingly robust to interpolation, or moving within the data points provided. What such a model struggles with is extrapolating outside the data points provided during training.⁠[9] A low training loss is therefore evidence about the past, not a promise about the future.

Regularization is the general name for the measures that hold a model back from fitting its training data too closely. Without augmentation, or regularization more generally, deep neural networks are prone to learning spurious correlations and memorizing high-frequency patterns that are difficult for humans to detect. In text, this can mean high-frequency numeric patterns in token embeddings, or memorization of particular forms of language that do not generalize. The remedy is to make the training problem slightly harder than mere memorization would require, so that the model must resort to learning abstractions of information which are more likely to generalize.⁠[9] Regularization is thus not a correction applied after training goes wrong; it is part of how the loop is set up.

The loop also has a cost that sits outside the mathematics. Collecting annotated datasets is very difficult at the scale required. One account of building a question-answering dataset describes the authors working for 23 hours to produce 124 question-answer pairs, and fitting 124 annotations without overfitting is described as extremely challenging in the current state of deep learning. A second effort collected 5.4K summaries of 3.2K machine learning papers, which required employing 28 undergraduate students to refine data bootstrapped from an existing platform.⁠[9] These figures are not complaints about particular projects; they show the exchange rate between human hours and usable training examples.

That exchange rate explains much of the field's direction. Deep learning can achieve remarkable performance through the combination of this learning strategy and large labeled datasets, but collecting these annotated datasets is very difficult at the scale required.⁠[9] The loop described here, prediction compared against a recorded answer and settings adjusted to shrink the gap, is simple enough to state in a paragraph. Everything difficult about supervised learning lies in supplying the answers it runs on and in judging honestly what the fitted model has actually learned, a problem taken up later.

A loss function converts the gap between prediction and recorded label into a number the model can reduce; regularization keeps that reduction from becoming mere memorization.

The families of supervised algorithms

Once the data are labeled and the loss is set, the remaining choice is which kind of model to fit. The families differ in how they draw the boundary between classes, and the differences show up in two practical places: how accurately they tend to perform and how easily a person can see why they gave an answer. A binary classification task can be addressed by artificial neural networks, k-nearest neighbors, support vector machines, random forest, gradient boosting, or other methods.⁠[1] Each name stands for a distinct way of turning inputs into a label, and none is best in every setting.

Five colored panels contain a decision tree, three voting trees, a nearest-neighbor plot, a layered neural network and a sequence of boosting trees.
Decision trees, random forests, nearest neighbors, neural networks and boosting use different mechanisms to produce predictions. The examples show branching rules, voting, local neighbors, layered connections and sequential trees. View full-size image.Mechanisms of Supervised Algorithm Families by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Frequency of use is not the same as accuracy, and the same review found that the random forest, an ensemble that combines many decision trees, showed superior accuracy comparatively: of the 17 studies where it was applied, it had the highest accuracy in 9, or 53 percent, followed by support vector machines, which topped 41 percent of the studies in which they were considered. The comparison was restricted to studies that ran more than one algorithm on the same disease and data, so that the algorithms were judged under a common setting rather than across differing ones.⁠[6]

Decision trees split the data by asking a sequence of yes-or-no questions about the features, and a forest is a large collection of such trees whose answers are pooled. Tree-based methods stand out among supervised learners as non-parametric methods that combine interpretability, efficiency, and, when used in ensembles of trees, excellent accuracy.⁠[10] That combination is unusual: a single tree can be read as a set of rules a person can follow, while the ensemble that improves its accuracy gives up much of that transparency. The trade is a general one. A model simple enough to explain is often less accurate than one that is not, and the choice between them depends on whether the answer has to be justified to someone.

k-nearest neighbors takes a different route entirely: it stores the training examples and classifies a new input by looking at the labels of the most similar stored cases. Nothing is fitted in advance, and the decision is local, resting on whichever examples happen to lie nearby. Neural networks sit at the opposite end, building a layered internal representation and adjusting many internal settings during training. Gradient boosting builds its ensemble in stages, each new tree correcting the errors of those before it. These mechanisms are covered later; what matters here is that the families are not interchangeable, and the survey's ranking of random forest above the others is a statement about one collection of disease-prediction studies, not a general law.⁠[6]

The choice is further complicated because the same algorithm can produce different results on the same data depending on how its settings are chosen. The selection of different kernels for support vector machines can vary accuracy outcomes for the same dataset, and a random forest can give different results as the number of trees within it changes.⁠[6] A reported comparison therefore reflects the algorithms as they were configured, not the families in the abstract.

Learning from a teacher who is not there: internal models and distal supervision

Every training loop described so far assumes that the correct answer can be compared directly with the model's output. The label sits beside the input, the loss measures the gap, and the settings move to close it. That arrangement breaks down when the thing being learned is a sequence of actions and the outcome arrives late, after the actions have already been taken and after an unknown system has transformed them into a result. The teacher in supervised learning is whatever supplies the correct answer, and in this setting the teacher is distal: the desired outcome is separated from the action by a dynamical system whose behavior is not known in advance.

The difficulty is not merely delay. If the intervening system were known, its equations could be inverted and the desired outcome converted into the action that would produce it, which would restore an ordinary labeled example. What makes the problem hard is that the system is unknown and must itself be learned. The proposal that resolves it is to give the adaptive system an internal model: a learned component that predicts what the environment will do in response to an action, so that the system carries its own approximation of the missing link. The approach uses learned internal models as components of the adaptive system.⁠[11]

This is the argument made for forward models as a way of solving certain classical problems associated with the notion of the teacher in supervised learning, by using learned internal models as components of the adaptive system. The approach is stated to apply to any supervised learning algorithm capable of learning in multilayer networks, and it is shown to handle cases in which an unknown dynamical system intervenes between actions and desired outcomes.⁠[11]

A second thread ties this back to the rest of the chapter. Supervised learning is the inference of a functional mapping from a set of training examples, and to achieve good generalization it is necessary to control the complexity of the learned function.⁠[12] That requirement does not disappear when the teacher is distal; it doubles. The forward model must generalize beyond the actions it was trained on, or the controller will be optimized against a fiction, and the controller must generalize in turn.

When the answer arrives only after an unknown system has acted, a learned forward model can supply the missing comparison, at the price of trusting a second model to generalize.

Uses

Diagnosis from images and tissue

The clearest demonstrations of supervised learning come from medicine, where the input is an image and the label is a diagnosis that a specialist has already made. Skin cancer is diagnosed primarily by visual inspection, beginning with a clinical screening and followed in some cases by dermoscopic analysis, a biopsy and a histopathological examination.⁠[13] That sequence makes the problem a natural fit for a classifier: the images exist in large numbers, and the answer for each one is recorded in the medical record. The difficulty is that skin lesions vary finely in appearance, so the boundary between a dangerous lesion and a harmless one is not a simple visual rule.

A close-up dermoscopic view of a brown and reddish pigmented skin lesion with a lobulated surface on pale skin with fine body hairs.
A close-up dermoscopic view of a brown and reddish pigmented skin lesion with a lobulated surface on pale skin with fine body hairs. View full-size image.Nevus melanocítico intradérmico (RPS 09-12-2019) imagen dermatoscópica by Raimundo Pastor. CC BY 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.
Figure 1. Area under the ROC curve for algorithms and pathologists in the lymph node metastasis challenge. The best submitted algorithm, the top five algorithms on average, and pathologists with and without a time constraint, on the same test set of 129 whole-slide images. The source states: “the best algorithm (AUC, 0.994 [95% CI, 0.983-0.999]) performed significantly better than the pathologists WTC in a diagnostic simulation (mean AUC, 0.810 [range, 0.738-0.884]; P < .001). The top 5 algorithms had a mean AUC that was comparable with the pathologist interpreting the slides in the absence of time constraints (mean AUC, 0.960 [range, 0.923-0.994] for the top 5 algorithms vs 0.966 [95% CI, 0.927-0.998] for the pathologist WOTC).” (Ehteshami Bejnordi et al. (2017)).⁠[2]

A convolutional neural network, the image-oriented kind of deep model, was trained end to end on pixels and disease labels alone, using 129,450 clinical images covering 2,032 different diseases, a dataset two orders of magnitude larger than earlier ones. The trained network was then tested against 21 board-certified dermatologists on biopsy-proven images in two binary tasks: telling keratinocyte carcinomas from benign seborrheic keratoses, the most common cancers, and telling malignant melanomas from benign nevi, the deadliest skin cancer. On both tasks the network performed on par with all the tested experts.⁠[13] The result is a statement about agreement with specialists on those two comparisons, not a claim that the system replaces a biopsy; what it shows is that a supervised model can reach specialist-level discrimination on a narrow, well-labeled visual task.

The same pattern appears in pathology, where the images are whole-slide tissue sections rather than photographs of skin. The CAMELYON16 challenge asked participants to build algorithms that detect metastases in hematoxylin and eosin-stained lymph node sections from women with breast cancer, and supplied a training set of whole-slide images from two centers in the Netherlands, 110 with nodal metastases and 160 without, each verified by immunohistochemical staining. Performance was judged on a separate test set of 129 whole-slide images, 49 with and 80 without metastases, which was also read by a panel of 11 pathologists working under a time constraint in a two-hour session designed to mimic routine workflow, and by one pathologist with no time constraint.⁠[2]

The spread of results is as instructive as the best one. The area under the receiver operating characteristic curve, a measure of how well a classifier separates the two classes across all decision thresholds, ranged from 0.556 to 0.994 across the submitted algorithms. The best algorithm reached 0.994 on the slide-level classification task, significantly better than the time-constrained pathologists, whose mean was 0.810, while the top five algorithms averaged 0.960, comparable to the single pathologist reading without a time limit at 0.966. The comparison is between a machine and a simulation of rushed clinical work, and whether the approach has clinical utility will require evaluation in a clinical setting.⁠[2] Still, the gap between the best and worst submissions shows how much of the outcome depends on how the model is built, not merely on whether supervised learning is used at all.

Screening offers a third setting, one where the label is a grade of disease rather than its presence. A deep learning system was trained on retinal images to detect diabetic retinopathy, using 76,370 images, and separately on 125,189 images for possible glaucoma and 72,610 for age-related macular degeneration. In a primary validation set of 14,880 patients and 71,896 images, referable diabetic retinopathy had a prevalence of 3.0 percent, and the system reached an area under the curve of 0.936 for it, with sensitivity of 90.5 percent and specificity of 91.6 percent; for vision-threatening retinopathy the area was 0.958, with sensitivity of 100 percent and specificity of 91.1 percent. Across ten additional datasets the area for referable retinopathy ranged from 0.889 to 0.983.⁠[3]

That last figure matters because it tests the same model on populations it was not trained on. A classifier learns the relationship between images and labels in its training data, and the question for deployment is whether that relationship holds elsewhere. The range across the additional cohorts, 0.889 to 0.983, brackets the primary result of 0.936, extending both below and above it.⁠[3] The three examples together show what supervised diagnosis can do and where its limits sit, in the quality of the labels, the narrowness of the task, and the difference between the test set and the clinic. How such systems are judged numerically, and why a single accuracy figure can mislead, is covered later.

Risk scores, gene expression and the clinic

Not every clinical label is a diagnosis read off an image. Some are outcomes that have not happened yet, and the input is a profile of which genes a tumor is expressing. Breast cancer provides a well-studied case. A risk model here means a rule that combines measurements into an estimate of how a patient's disease will behave, and the aim was to improve on existing standards for prognosis and for predicting whether a patient would benefit from chemotherapy by building the model around gene expression subtypes rather than clinical features alone.⁠[5]

The subtypes are the familiar molecular groupings of breast cancer: luminal A, luminal B, HER2-enriched and basal-like. A 50-gene predictor was developed from microarray and quantitative reverse transcriptase polymerase chain reaction data on 189 prototype samples, and then tested on 761 patients who had received no systemic therapy, for prognosis, and on 133 patients, for prediction of pathologic complete response to a taxane and anthracycline regimen. The subtypes as discrete entities showed prognostic significance and remained significant in multivariable analyses that incorporated estrogen receptor status, histologic grade, tumor size and node status.⁠[5] That last point is the one that matters for the idea: the gene-based grouping carried information that the standard clinical measures did not already contain.

Prediction of treatment benefit is a harder and more useful question than prognosis, because it asks not what will happen but what should be done. The subtype model predicted neoadjuvant chemotherapy efficacy with a negative predictive value for pathologic complete response of 97 percent. A prognostic model for node-negative breast cancer was also built from subtype and clinical information, and the combined model's C-index, a measure of how well a risk score ranks patients by outcome, was a significant improvement on either the clinicopathologic model or the subtype model alone.⁠[5]

The same logic, applied to a single disease with many candidate algorithms, is what the disease-prediction comparison set out to measure. Its authors restricted the review to studies that ran more than one supervised algorithm on the same disease and data, on the grounds that comparing one algorithm's performance across different study settings can be biased and produce erroneous results.⁠[6] The restriction is a small methodological point with large consequences: a reported accuracy means little unless the alternative was tested on the same cases.

A plainer example comes from diabetes. Using the Pima Indian Diabetes dataset, which holds records for 768 patients and nine attributes, seven machine learning algorithms were compared for predicting the disease, and logistic regression and support vector machines worked well; a neural network with two hidden layers reached 88.6 percent accuracy.⁠[4] The figure is a single result on a single dataset, and it says nothing about which family is best in general. What the clinical examples share is that the label is expensive and consequential, so the choice of model and the honesty of its score are part of the medicine, not a preliminary to it. How those scores are computed, and why a bare accuracy figure can flatter a model, is covered later.

A gene-expression risk score earns its place only if it adds information beyond the standard clinical measures, and a treatment predictor is judged by how often its confident negatives are right.

Reading the land, the sky and the text

The same machinery that reads a skin lesion or a gene profile also reads a satellite image, a retinal photograph, a light curve, a microbial community and a news article. In each case a person has already assigned the label, and the classifier's job is to reproduce that judgment on new cases. What changes from one field to the next is the shape of the input and the cost of getting the labels right.

Land cover is a case where the label is a category assigned to every patch of ground. A study of Haiti used Landsat Thematic Mapper imagery from 2010 to 2011, normalized the digital numbers against stable reference patches, and then applied a supervised classification following the United Nations Food and Agriculture Organization's land cover scheme. The result put tree cover at about 32.3 percent of the country's land area, a figure confirmed by an error-adjusted estimator at 32.4 percent, and dropping to 29.4 percent once the map was standardized to the FAO's stricter definition of forest.⁠[14] That gap between 32.3 and 29.4 is not noise; it is the definition of the label doing real work. The same trees count or do not count depending on how "forest" was specified before training began, which is why the label scheme is part of the method rather than a detail settled afterward.

Medical images supply a second kind of input, one where the label is a boundary drawn pixel by pixel. In retinal imaging, the task of segmentation means deciding, for each pixel, whether it belongs to a blood vessel or to background. One method built a feature vector for every pixel from its intensity and from two-dimensional Gabor wavelet responses taken at multiple scales, then classified each pixel with a Bayesian classifier whose class-conditional densities were modeled as Gaussian mixtures, with the distributions estimated from a training set of manually labeled pixels. On the public DRIVE database the method reached an area under the receiver operating characteristic curve of 0.9614. The wavelet step is worth noticing: it tunes to specific frequencies, so noise filtering and vessel enhancement happen in a single pass before the classifier ever sees the data.⁠[15] The hand-built feature and the learned decision still cooperate here, rather than one replacing the other.

Astronomy offers a third setting, where the input is a light curve, the record of a star's brightness over time, and the label is a variability type. A random forest was trained to sort Hipparcos periodic variable stars into 26 types, using the subset of stars whose variability type was most reliably established in the literature as the training material. The attributes that carried the most information, in decreasing order, were the period, the amplitude, the V−I colour index, the absolute magnitude, the residual around the folded light-curve model, the skewness of the magnitude distribution, and the amplitude of the second harmonic of the Fourier series relative to the fundamental. In ten-fold cross-validation the rate of correct classification ran between 90 and 100 percent depending on the type, with the main confusions, up to about 10 percent, falling between SPB and ACV blue variables and among eclipsing binaries, ellipsoidal variables and other types.⁠[16] The ranking of attributes is the interesting part: it says which measurements a person would need to look at, and it came out of the fitted model rather than being assumed in advance.

Microbial communities and text push the input further from anything a person can see. In each, the number of possible features is enormous and most of them are rare, which is the setting where supervised classifiers have long been used to pick out the few measurements that discriminate one group from another. The scoring of such classifiers, and the reasons a single accuracy figure can flatter them, is covered later.

Across land, sky, tissue and text, the classifier reproduces a label a person defined; the definition, not the algorithm, decides what the answer means.

Research

Judging a classifier: accuracy and its blind spot

A trained classifier produces, for each example, a predicted label that can be set beside the true one. The four ways that comparison can come out are named together as the confusion matrix: a true positive is a positive example correctly called positive, a false negative is a positive called negative, a true negative is a negative correctly called negative, and a false positive is a negative called positive.⁠[1] Every summary score in common use is some arithmetic on these four counts, and the arithmetic is where the trouble starts.

A 2x2 confusion matrix grid with rows labeled Actual Values Positive and Negative, columns labeled Predicted Values Positive and Negative, and cells labeled TP, FN, FP, and TN.
A 2x2 confusion matrix grid with rows labeled Actual Values Positive and Negative, columns labeled Predicted Values Positive and Negative, and cells labeled TP, FN, FP, and TN. View full-size image.Confusion matrix; sep 2025 by Arthur-Kunst. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

The most natural score is the share of examples classified correctly. Accuracy is the ratio between the number of correctly classified samples and the overall number of samples, and by its definition it also works when there are more than two labels. It is easy to compute and easy to explain, which is why many researchers regard it as the most reasonable performance metric.⁠[1] Its blind spot appears when the classes are lopsided. When the dataset is unbalanced, meaning the number of samples in one class is much larger than the number in the others, accuracy cannot be considered a reliable measure anymore, because it gives an overoptimistic estimate of the classifier's ability on the majority class.⁠[1] A classifier that always answers with the common class can post a high accuracy while never once identifying the rare one, and the score will not show it.

A worked case makes the failure concrete. Take a clinical dataset of 100 people, 91 of them sick and 9 healthy, and suppose the classifier labels 90 of the 91 sick patients correctly while recognizing only 1 of the 9 healthy ones. Accuracy comes out at 0.90, close to the best possible value of 1.00, and the F1 score, a measure that combines how often the positive class is found with how often a positive prediction is right, comes out at 0.95.⁠[1] Read those two numbers alone and the method looks excellent. In fact it has almost no talent for the healthy class, and its overall performance should be judged poor.⁠[1] The high scores are not a bug in the arithmetic; they are an accurate report of a classifier that has learned to favor the group that dominates the data.

The same distortion appears when the classes are evenly split, so imbalance is not the only trigger. With 50 healthy and 50 sick patients, a classifier that correctly identifies 47 of the 50 sick but only 5 of the 50 healthy is again mediocre overall. Here the F1 score reads 0.66, a figure that would leave someone satisfied, while the truth is that the algorithm has performed poorly on the negative subset. Accuracy, in this balanced case, gives a more informative 0.52.⁠[1] The lesson is not that one measure is always right but that each score answers a narrower question than it appears to. Accuracy asks how often the classifier is right; it does not ask whether it is right about the cases that matter.

What the confusion matrix offers is the breakdown that a single number hides. A classifier can be strong on one class and weak on the other, and only the four counts, or a score built to weigh all four, will say so. The F1 score is one attempt at such a score, and it has its own blind spot: it is computed from precision and recall, both of which concern the positive class, and it is independent from the number of samples correctly classified as negative.⁠[1] A measure that stays high only when all four categories do well is the subject of the next section, along with the other scores in common use and the settings in which each is the better choice.

Accuracy answers "how often is the classifier right?" and stays silent on "right about which class?"; on lopsided data those are very different questions.

The Matthews correlation coefficient and other measures

The previous section showed that accuracy and the F1 score can both stay high while a classifier fails badly on one class. What is wanted is a score that stays high only when the classifier does well on all four cells of the confusion matrix at once. The Matthews correlation coefficient (MCC) is such a score. It produces a high value only if the prediction obtained good results in all four categories, true positives, false negatives, true negatives and false positives, proportionally both to the size of the positive elements and the size of the negative elements in the dataset.⁠[1] A classifier that ignores the healthy patients entirely cannot earn a high MCC, because its false positives and true negatives drag the value down.

A two-by-two patient confusion matrix sits beside accuracy, F1 and MCC calculations, above a scale from minus one to plus one.
A classifier misses every healthy patient despite high accuracy and F1. MCC uses all four confusion-matrix cells and is approximately −0.032. View full-size image.Matthews Correlation on Imbalanced Data by Atlas Nova. Illustration generated with AI for this article and checked against its text.

The measure has an unusual history for a machine learning metric. It was originally developed by Matthews in 1975 for the comparison of chemical structures, and was re-proposed by Baldi and colleagues in 2000 as a standard performance metric for machine learning, with a natural extension to the multiclass case. It also found a use outside research: the US Food and Drug Administration employed MCC as the main evaluation measure in its MicroArray II and Sequencing Quality Control projects.⁠[1]

The worked case from the previous section shows the difference in practice. On the lopsided dataset of 91 sick and 9 healthy patients, where accuracy read 0.90 and F1 read 0.95, the MCC came out at −0.03. A value near zero on a scale that runs from −1 to +1 tells the reader plainly that the method has performed poorly, which is exactly what the other two scores concealed. In the balanced case of 50 and 50, where F1 read 0.66, the MCC was +0.07, close to random guessing, while accuracy gave the more informative 0.52. In the lopsided case accuracy and F1 were both flattered while MCC was not; in the balanced case F1 was flattered, MCC signalled near-random performance, and accuracy gave the more informative 0.52.⁠[1]

MCC is not the only alternative, and the others answer different questions. Shifting from classification to information retrieval, and reading the positive class as the relevant documents, recall is the fraction of relevant samples that are correctly retrieved, and its dual, precision, is the fraction of retrieved documents that are relevant. The pair gives useful insight into a classifier's behavior and can be more informative than the pair of sensitivity and specificity. Their harmonic mean is the F1 score, introduced independently in statistical ecology by Dice and by Sørensen in 1948, rediscovered in information theory in the 1970s, and given its current name in 1992.⁠[1]

Two further measures deserve mention. Cohen's kappa was originally developed to test inter-rater reliability and later entered machine learning for comparing classifiers, but in the learning context it has issues that make it unreliable, among them a high sensitivity to the distribution of the marginal totals. Informedness, proposed by Powers, is defined as the true positive rate minus the true negative rate, expressing how informed the predictor is in relation to the opposite condition. When no single threshold for the confusion matrix is available, the area under the receiver operating characteristic curve (ROC AUC) is the popular choice, computed across all possible thresholds, though it too has flaws and is sensitive to class imbalance. The precision-recall curve is the analogous construction for precision and recall, and several scientists consider it more informative than the ROC curve, especially on imbalanced biological and medical datasets.⁠[1]

A score is only as trustworthy as the cells of the confusion matrix it refuses to ignore.

Comparing algorithms fairly

A comparison between two classifiers is itself a measurement, and like any measurement it can be wrong. Suppose two algorithms are trained on the same data and scored on the same test set, and one comes out a point or two ahead. That gap may reflect a real difference in how the two methods learn, or it may reflect the particular split of cases into training and test material, which is one draw from a much larger pool of possible splits. Deciding which of these is happening requires a statistical test, and the choice of test turns out to matter more than intuition suggests.

The relevant error is the one made when no difference exists. A test that declares a winner too readily will report a difference between two algorithms that are in fact equivalent, and this is called a type I error: detecting a difference when none is there. Five approximate tests for comparing supervised classification algorithms were reviewed and compared experimentally on exactly this probability. Two widely used tests were found to have a high probability of type I error in certain situations and, in the author's judgment, should never be used: a test for the difference of two proportions, and a paired-differences t test based on taking several random train-test splits.⁠[17] Both are natural things to reach for, which is what makes the finding worth stating plainly.

A third test, a paired-differences t test based on 10-fold cross-validation, showed a somewhat elevated probability of type I error. McNemar's test, which compares the two classifiers' disagreements case by case rather than comparing their overall scores, was found to have low type I error. A new test was also proposed, called 5×2 cross-validation, built on five iterations of twofold cross-validation, and it too showed acceptable type I error. The same work measured power, the ability to detect a difference when one genuinely exists, and found the cross-validated t test the most powerful, with 5×2 cross-validation slightly more powerful than McNemar's test.⁠[17]

The practical recommendation follows from cost. For algorithms that can be executed only once, McNemar's test is the only one with acceptable type I error; for algorithms that can be run ten times, 5×2 cross-validation is recommended, because it is slightly more powerful and because it directly measures variation due to the choice of training set.⁠[17] A later variant, the combined 5×2 cross-validation F test, combines multiple statistics into a single test, and simulation results showed it has lower type I error and higher power than 5×2 cross-validation proper.⁠[18] The lesson generalizes beyond these particular tests: a claim that one learner beats another is a statistical claim, and it deserves the same scrutiny as the accuracy figures it rests on.

A reported gap between two algorithms is a hypothesis, not a result, until a test with controlled error rates says otherwise.

When labels are scarce or imperfect

The training loop described earlier assumes a labeled example for every case the model sees, and that assumption is the expensive part of supervised learning. One response is to squeeze more out of the labels already in hand. Data augmentation is a set of algorithms that construct synthetic data from an available dataset, typically by making small changes that the model's predictions should be invariant to.⁠[9] A photograph of a cat is still a photograph of a cat after it is rotated or its brightness is raised, so the transformed copy carries the same label and teaches the model that the transformation should not change its answer. In text the same idea is harder to apply, because deleting or swapping words can alter meaning, though small edits such as synonym swaps or controlled paraphrases can serve.⁠[9]

Augmentation works as a form of regularization. Without it, deep networks are prone to learning spurious correlations and memorizing high-frequency patterns that are difficult for humans to detect; presented with shuffled and perturbed versions of the same material, the model must resort to learning abstractions of information which are more likely to generalize. Training on examples slightly different from the originals also adds space between each example and its class boundary, which yields more robust classifiers and uncertainty estimates.⁠[9] The gain is real but bounded: augmentation rearranges and perturbs what was already labeled, and cannot supply a category the labels never covered.

A second response uses the unlabeled cases that are usually far more plentiful. Semi-supervised learning is the branch of machine learning concerned with using labeled as well as unlabeled data to perform a learning task, sitting conceptually between supervised and unsupervised learning and permitting the large amounts of unlabeled data available in many settings to be combined with typically smaller labeled sets.⁠[19] The central trick is the pseudo-label: the model's own prediction on an unlabeled example, treated as if it were the true answer and used as a training target. Consistency regularization adds a second requirement, that the model give the same answer to two differently perturbed versions of the same unlabeled input.

FixMatch combines the two simply. It generates pseudo-labels from the model's predictions on weakly augmented unlabeled images, keeps a pseudo-label only when the prediction is high-confidence, and then trains the model to reproduce that label when fed a strongly augmented version of the same image. Despite its simplicity, it reached 94.93 percent accuracy on CIFAR-10 with 250 labels and 88.61 percent with 40 labels, just 4 per class.⁠[20] MixMatch, an earlier method that guesses low-entropy labels for augmented unlabeled examples and mixes labeled and unlabeled data, reduced the CIFAR-10 error rate with 250 labels from 38 percent to 11 percent.⁠[21] These are benchmark results on particular datasets, and the size of the gain depends on how well the unlabeled pool matches the task.

Real labeling falls short in more specific ways than simple scarcity. Weakly supervised learning covers three typical kinds of weak supervision: incomplete supervision, where only a subset of training data is given with labels; inexact supervision, where the training data carry only coarse-grained labels; and inaccurate supervision, where the given labels are not always ground-truth.⁠[8] The third is the most uncomfortable, because a model trained on wrong answers will learn them faithfully. One approach treats the problem as semi-supervised: DivideMix models the per-sample loss distribution with a mixture model to divide training data into a labeled set of clean samples and an unlabeled set of noisy ones, then trains on both, using two diverged networks so that each network's data division comes from the other and confirmation bias is avoided.⁠[22] The reframing is the point: a wrongly labeled example is not useless, only untrustworthy, and can be handled as an unlabeled case whose label the model must infer.

When labels run short, the available moves are to stretch the labeled examples through augmentation, to recruit unlabeled ones through pseudo-labels, or to treat bad labels as missing rather than true.

Missing values, imbalance and tuning

Real datasets arrive damaged. A patient record may lack a lab value, a survey may have a blank field, and most learning algorithms handle missing data in a rather naive way, which matters because careless treatment can introduce bias into what the model learns. Imputation is the procedure that replaces missing values with plausible ones, and its advantage is that the treatment is independent of the learning algorithm used, so the same repaired dataset can be handed to any classifier.⁠[23] One simple imputation method fills each gap with the mean or mode of the column; a more careful one, k-nearest-neighbour imputation, looks at the cases most similar to the incomplete one and borrows from their values. In an analysis of four treatment methods, imputation based on the k-nearest-neighbour algorithm outperformed the internal methods used by the C4.5 and CN2 algorithms to treat missing data, and also outperformed mean or mode imputation.⁠[23] The comparison is between repair strategies on the same data, and it says that how a gap is filled can change what the model concludes.

A source table branches into mean and nearest-neighbor calculations, each producing a repaired row that leads to a classifier.
Mean imputation and two-neighbor imputation fill the same missing value with 18 and 12 respectively. Distances on the observed feature determine the two nearest records. View full-size image.Two Methods for Missing Values by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Imbalance is the second pitfall, and it is a property of the data rather than of the algorithm. When one class vastly outnumbers another, a classifier can score well by favouring the majority, and the evaluation measures that would reveal this are covered later. Source lists the application of data augmentation to alleviate issues caused by class imbalance among the practical implementation topics it covers.⁠[9]

Tuning is the third. The same algorithm can generate different accuracy results for the same dataset when different values are chosen for its hyperparameters, the settings fixed before training begins rather than learned from the data. The selection of different kernels for support vector machines can vary accuracy outcomes on one dataset, and a random forest can give different results as the number of trees within it changes.⁠[6] A reported comparison therefore reflects the algorithms as they were configured, not the families in the abstract, which is why a review that ignored hyperparameter choices would be comparing configurations as much as methods.

Underneath all three sits the cost of the labels themselves. Collecting annotated datasets is very difficult at the scale required, and the difficulty is measured in human hours: one question-answering dataset took 23 hours of work to produce 124 question-answer pairs, and fitting 124 annotations without overfitting is described as extremely challenging in the current state of deep learning. A second effort gathered 5.4K summaries of 3.2K papers and required 28 undergraduate students to refine data bootstrapped from an existing platform.⁠[9] Cleaning, balancing and tuning all presuppose that someone has already paid that price.

Missing values, skewed classes and untuned settings each distort a result before any score is computed; the label budget sits underneath all three.

Contrastive objectives and the geometry of learned representations

A classifier's final answer is a label, but underneath that answer sits a representation: the internal vector of numbers the model computes for each input before it decides. The quality of that representation shapes what the classifier can do. A suitable data representation gives improved performance compared with a poor one, which is why so much machine learning research has gone into constructing good features from raw data.⁠[7] Deep networks build the representation inside themselves, layer by layer, and the question this section takes up is how the geometry of that internal space can be shaped deliberately rather than left to emerge as a by-product of label prediction.

Three side-by-side neural network diagrams labeled Supervised, Unsupervised, and Self-supervised, each with an input cow icon, with the self-supervised version also showing a second input labeled 'moo' linked by an arrow.
Three side-by-side neural network diagrams labeled Supervised, Unsupervised, and Self-supervised, each with an input cow icon, with the self-supervised version also showing a second input labeled 'moo' linked by an arrow. View full-size image.Supervised, Unsupervised, and Self-Supervised Learning by Xiao Liu, Fanjin Zhang, Zhenyu Hou, Li Mian, Zhaoyu Wang, Jing Zhang, Jie Tang. CC BY 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

Contrastive learning is a family of training objectives that works on this geometry directly. Instead of asking a model to name the class of each example, it asks the model to place examples in an embedding space, a high-dimensional coordinate system where similar items should land near one another and dissimilar items far apart. Clusters of points belonging to the same class are pulled together in embedding space, while simultaneously pushing apart clusters of samples from different classes. Modern batch contrastive approaches subsume or significantly outperform older contrastive losses such as triplet, max-margin and the N-pairs loss.⁠[24]

The self-supervised version of this idea manufactures its own notion of similarity: two distorted versions of the same image count as a matched pair, and the model learns to bring their embeddings close. Supervised contrastive learning replaces that manufactured pairing with the real labels. The label is used only to decide which points belong together, not to be predicted directly, so the training signal is about the arrangement of the whole space rather than about one answer per example.

The results reported for this objective are worth stating with their scope. On ResNet-200, a particular network architecture, supervised contrastive learning reached a top-1 accuracy of 81.4 percent on the ImageNet dataset, which is 0.8 percent above the best number reported for that architecture. The same work reports consistent outperformance over the standard cross-entropy objective on other datasets and two ResNet variants, and notes that the loss shows benefits for robustness to natural corruptions and is more stable to hyperparameter settings such as optimizers and data augmentations.⁠[24] These are comparisons against a particular alternative on particular benchmarks; they say that shaping the embedding space this way can pay off, not that it always will.

The self-supervised counterpart attacks a problem that arises when no labels are used at all. A recurring issue with learning embeddings invariant to distortions of the input sample is the existence of trivial constant solutions. Barlow Twins avoids this by measuring the cross-correlation matrix between the outputs of two identical networks fed distorted versions of a sample, and making that matrix as close to the identity matrix as possible. The effect is to make the embeddings of a sample's distorted versions similar while minimizing the redundancy between the components of those vectors, so that different dimensions of the representation carry different information rather than repeating it.⁠[25] The method is named for the neuroscientist H. Barlow's redundancy-reduction principle, applied to a pair of identical networks.⁠[25]

Both approaches rest on the same premise, that a representation can be judged as a structure in its own right, apart from any single prediction. Whether the resulting space is good shows up downstream, when a simple classifier is fitted on top of it or when the model is transferred to a new task. The contrastive objective is therefore a way of preparing the ground, and the measures used to judge what grows on it are the ones the chapter has already set out.

Risks and limits

How hard is the problem? Complexity, dimensionality and the limits of intuition

Two classifiers can be compared on the same data, and the comparison still leaves a question untouched: how difficult was the problem in the first place? Some classification tasks are nearly separable, with classes that sit in distinct clumps; others have boundaries so tangled that no method does well. A complexity measure is a number computed from the data alone, before any model is fitted, that characterizes how hard a classification problem is, with attention focused on the geometrical complexity of the class boundary.⁠[26] The idea is to describe the task rather than the solution, so that a poor result can be attributed to the problem instead of to the algorithm.

The way to know whether such a measure means anything is to compare real problems against problems with no structure at all. Random labeling serves as a baseline because it has no structure: real problems were compared to random labelings of points and found to contain structures in this measurement space that are significantly different from the random sets.⁠[26] If real data looked like random labelings in these measurements, the measures would be describing nothing.

The distributions of problems in that space show that at least two independent factors affect a problem's difficulty.⁠[26] Difficulty is therefore not a single quantity that can be ranked on one axis; two datasets can be hard for different reasons. That has a practical use. The same work suggests using this space to describe a classifier's domain of competence, which can guide the static and dynamic selection of classifiers for specific problems and for subproblems formed by confinement, projection and transformations of the feature vectors.⁠[26] A model's record can be summarized as a region of problem space where it tends to succeed, and a new task placed in that region is a better bet than one outside it.

Intuition is a poor guide to that space, particularly when the inputs have many dimensions. The warning comes from remote sensing, where a system such as AVIRIS collects image data in 220 bands, and the increased dimensionality greatly enhances the information content while challenging the techniques used to analyze it. In such data, human experience in three-dimensional space tends to mislead intuition of the geometrical and statistical properties of high-dimensional space, and those properties must guide choices in the data analysis process.⁠[27]

What goes into the feature vector is a further lever on difficulty, and it is not neutral. Pre-selection of informative features for supervised classification is a crucial and delicate task, and it is desirable that feature selection provide the features that contribute most to the classification task itself, which should then be used by any classifier later applied to produce classification rules.⁠[28] A problem can be made easier or harder by the measurements chosen to represent it, so a difficulty score describes the data as it was presented, not the underlying phenomenon in some absolute sense.

Difficulty is a property of the data and its features, not only of the algorithm; real problems occupy a measurable region distinct from random labeling, and three-dimensional intuition does not survive the trip to high dimensions.

Later developments

Spiking networks and biological plausibility

The classifiers discussed so far pass numbers between their layers, but the brain does not work that way. Neurons in biological circuits form intricate networks in which the primary mode of communication occurs through spikes, brief electrical pulses that carry information in their timing as well as their rate.⁠[29] A spiking neural network is a model built from units that fire discrete spikes over time, so that both the input and the desired output are patterns of pulses rather than fixed vectors of values. This makes supervised learning harder in a specific way: the error has to be measured between two trains of spikes, and the moment a spike occurs is the very point at which the model's output is least smooth.

That last property is the obstacle. Most spiking neuron models are inherently nondifferentiable at spike time, and the derivative of their output with respect to synaptic weights is zero at all other times.⁠[29] Gradient-based training, the workhorse of ordinary networks, needs a slope to follow, and here the slope is either undefined or flat. A surrogate gradient gets around this by substituting a smooth stand-in for the true derivative during training, so that the usual machinery can be applied to a model that is not, strictly, differentiable.

The SuperSpike rule applies this idea to multilayer networks of deterministic leaky integrate-and-fire neurons, a common spiking model in which a neuron accumulates input until its voltage crosses a threshold and it fires. The resulting update is a nonlinear, voltage-based three-factor learning rule, and the method can train such networks to perform nonlinear computations on spatiotemporal spike patterns even when the hidden units start out completely silent. The three factors have biological readings: a nonlinear dependence on voltage, a window of temporal coincidence that agrees with spike-timing-dependent plasticity, and a multiplicative error signal that could arise from neuromodulators.⁠[29]

How the error reaches the hidden layers is a separate question, and one with consequences for biology. The method of weight updates implemented by standard backpropagation of error is thought to be biologically implausible.⁠[29] Feedback alignment is the proposal that the feedback need not match, and SuperSpike was tested under uniform, symmetric and random feedback. Simpler tasks could be solved with any type of feedback, while more complex tasks required symmetric feedback.⁠[29] The finding is a boundary rather than a verdict: it says how far the looser schemes stretch before they fail.

Earlier work had already shown that spiking neurons can be trained at all. The ReSuMe rule trains a neuron to reproduce arbitrary template spike patterns in response to given synaptic stimuli, even amid noise, and can be used for decision tasks in which neurons classify input signals by their temporal configuration alone, emitting a precisely timed spike train to signal the category.⁠[30] A multilayer algorithm later extended supervised learning to networks whose neurons fire multiple spikes, and it was applied successfully to classic linearly nonseparable benchmarks such as the XOR problem and the Iris dataset, requiring smaller networks than reservoir computing and converging faster than existing algorithms for similar tasks such as SpikeProp.⁠[31]

What this line of work offers is a test bed for questions about learning in the brain. If a rule of this kind can train a spiking circuit to transform one temporal pattern into another, then the question of whether real circuits learn by something similar becomes experimentally addressable rather than purely speculative. The gap between a trained model and a biological circuit remains wide, and the comparison is a research programme, not a settled result.

Spiking networks force supervised learning to handle time and discrete events; surrogate gradients and feedback alignment are the current ways of making the training work anyway.

Fairness, transparency and the black box

A supervised model that predicts well can still be wrong in a way that matters, and the wrongness need not show up in its score. Two questions sit beside accuracy: whether the model treats groups of people fairly, and whether anyone can tell why it produced a given answer. Both are properties of the fitted model rather than of the learning algorithm, and both have attracted methods of their own.

Equal opportunity

A model trained to predict a target, such as whether a loan will be repaid, can inherit patterns from the data that disadvantage a protected group. The setting is general: data about the predictor, the target and membership in the protected group are available, and the goal is to predict the target from the available features. Discrimination in this context means a disparity in the predictor's treatment of a specified sensitive attribute, and it is defined on the joint statistics of predictor, target and group rather than on any reading of an individual case.⁠[32] That choice of definition matters, because it means the disparity can be measured and, in principle, removed without inspecting individual decisions.

The adjustment proposed for the problem is to optimally adjust any learned predictor so as to remove discrimination according to the paper's definition. The framework also shifts the cost of poor classification from the disadvantaged group to the decision maker, who can respond by improving accuracy. A case study of FICO credit scores illustrates the notion. The approach is oblivious in the technical sense: it depends only on the statistics of predictor, target and group, not on interpretation of individual features. The same work sets out the inherent limits of defining and identifying bias from such oblivious measures, outlining what can and cannot be inferred from different oblivious tests.⁠[32] A fairness adjustment is therefore a statement about group rates, and it cannot certify that any single decision was just.

Opening the black box

The second question is transparency. Complex models such as neural networks, boosted trees, random forests and support vector regression can predict accurately while remaining opaque, and in sensitive areas such as healthcare or finance, understanding the decision making is of paramount importance. Explainability is the study of methods that make such a model's behavior understandable to a person, and the decision-making behind the black boxes needs to be more transparent, accountable and understandable for humans. The survey provides essential definitions and an overview of the different principles and methodologies of explainable supervised machine learning, classifying past and recent approaches according to its introduced definitions.⁠[33]

Plots that mislead

Partial dependence plots are the most popular approach for visualizing the effects of the predictors with black box supervised learning models.⁠[34] Their weakness is structural. Partial dependence plots can produce erroneous results if the predictors are strongly correlated, because they require extrapolation of the response at predictor values that are far outside the multivariate envelope of the training data.⁠[34] In plain terms, the plot asks the model what it would say about combinations of measurements that never occur together in the data, and the model answers anyway.

Accumulated local effects plots are an alternative that avoids this unreliable extrapolation with correlated predictors, and they are far less computationally expensive than partial dependence plots.⁠[34] The lesson is the one that runs through this chapter: a summary of a model is itself a measurement, and it can be wrong in ways the model is not. A plot that looks authoritative may be reporting the model's guess about impossible cases.

A model can be accurate, unfair and unexplained at once; fairness adjustments act on group rates, and explanation methods must be checked as carefully as the model they describe.

The cost of labels and the pull toward less supervision

The training loop at the heart of supervised learning runs on labeled examples, and the supply of those examples is the method's binding constraint. Collecting annotated datasets is very difficult at the scale required, and the difficulty is measured in human hours rather than in storage or computing power. One question-answering dataset took 23 hours of work to produce 124 question-answer pairs, and fitting 124 annotations without overfitting is described as extremely challenging in the current state of deep learning.⁠[9] These figures set the exchange rate between human labor and usable training examples, and that rate explains why so much current work asks how to learn from fewer labels.

Three horizontal lanes show labeled and unlabeled datasets feeding training, a masked token becoming a target, and previous weights feeding adaptation.
Three training pathways use unlabeled data or previously learned weights to reduce reliance on new human labels. The figure also shows a labeled evaluation set. View full-size image.Learning with Fewer Human Labels by Atlas Nova. Illustration generated with AI for this article and checked against its text.

The pull away from full supervision takes several forms, and they differ in what they assume about the data. Semi-supervised learning uses labeled as well as unlabeled data to perform a learning task, sitting conceptually between supervised and unsupervised learning and permitting the large amounts of unlabeled data available in many settings to be combined with typically smaller labeled sets.⁠[19] Self-supervised learning goes further: it describes a general set of algorithms that learn from unlabeled data with supervised learning, by algorithmically labeling the data. A token is masked out of a text and the masked token becomes the label, or an augmentation is applied to data and the model is tasked to predict the transformation.⁠[9] The supervision is manufactured from the data itself, so the human annotator drops out of the loop.

Transfer learning takes a different route, initializing a model with the weights learned from a previous task, usually one that had the benefit of big data, whether labeled or unlabeled.⁠[9] The earlier task supplies a general representation, and the new task needs only enough labeled examples to adapt it. The three approaches are not rivals so much as different answers to the same shortage.

The benchmark results that accompany these methods deserve careful reading. Semi-supervised algorithms have been tested in a suite of experiments designed to address issues they would face in real applications, and the findings were sobering: the performance of simple baselines which do not use unlabeled data is often underreported, semi-supervised methods differ in their sensitivity to the amount of labeled and unlabeled data, and performance can degrade substantially when the unlabeled dataset contains out-of-class examples.⁠[35] A method that shines on a standard benchmark may owe part of its margin to a baseline that was tuned less carefully, and an unlabeled pool drawn from a different distribution than the task can actively hurt. The gap between a benchmark and a deployment is therefore part of what the label shortage costs, since the cheap unlabeled data that make these methods attractive are exactly the data whose provenance is least controlled.

What remains constant across all of these strategies is the need to know whether the resulting model works. The chapter's earlier treatment of accuracy, the confusion matrix and statistical comparison applies unchanged to a model trained with almost no labels at all. Less supervision changes where the examples come from; it does not remove the obligation to check, honestly and on data the model has not seen, what was learned.

Unlabeled data can stand in for labels during training, but not during judgment: the test set still has to be labeled, and the score still has to be read with care.

Key studies

YearStudySampleDesignFinding
1998Dietterich⁠[17]five approximate statistical tests compared experimentallysimulation comparison of tests for algorithm differencesTwo tests had a high chance of reporting a difference where none existed and should never be used: a test comparing two proportions, and a paired-differences t test built on several random train-test splits.
1999Alpaydm⁠[18]simulation experiments on the 5 x 2 cv t test and a combined variantsimulation study of statistical testsThe combined 5 x 2 cv F test had lower type I error and higher power than the 5 x 2 cv test proper.
2009Parker et al.⁠[5]189 prototype samples, test sets from 761 patients without systemic therapy, and 133 patients evaluated for pathologic complete responsedevelopment and validation of a 50-gene subtype predictorFor predicting pathologic complete response to neoadjuvant chemotherapy, the subtype model's negative predictive value was 97%.
2011Dubath et al.⁠[16]Hipparcos periodic variable stars of 26 typesautomated supervised classification with random forests and 10-fold cross-validationThe rate of correct classification was between 90 and 100 per cent depending on the variability type.
2017Esteva et al.⁠[13]129,450 clinical images covering 2,032 diseases, tested against 21 board-certified dermatologistscomparison of a single trained convolutional neural network with expert dermatologists on biopsy-proven imagesThe network reached performance on par with all tested experts on both binary classification tasks.
2017Ehteshami Bejnordi et al.⁠[2]training images from 2 centers (110 with and 160 without metastases) and a test set of 129 whole-slide images, read by 11 pathologists with a time constraint and 1 withoutchallenge competition with independent test setThe best algorithm reached an area under the curve of 0.994, significantly better than the time-constrained pathologists' mean of 0.810.
2017Ting et al.⁠[3]development and validation of a deep learning system against professional gradersFor referable diabetic retinopathy the system reached an area under the curve of 0.936, sensitivity 90.5% and specificity 91.6%.
2019Uddin et al.⁠[6]48 articles covering 49 diseasesreview comparing supervised algorithms applied to single disease predictionThe support vector machine was applied in 29 studies and random forest had the highest accuracy in 9 of the 17 studies where it was used.
2019Berthelot et al.⁠[21]CIFAR-10 with 250 labels and STL-10semi-supervised algorithm evaluationOn CIFAR-10 with 250 labels, error rate fell by a factor of 4, from 38% to 11%.
2020Chicco & Jurman⁠[1]six synthetic use cases and one real genomics scenariomethodological comparison of evaluation measuresIn one imbalanced case, accuracy was 0.90 and F1 score 0.95 while the Matthews correlation coefficient was -0.03.
2020Sohn et al.⁠[20]CIFAR-10 with 250 labels and with 40 labelssemi-supervised algorithm evaluationFixMatch reached 94.93% accuracy with 250 labels and 88.61% with 40 labels, just 4 per class.

See also

References

  1. Chicco, D., & Jurman, G. (2020). The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genomics, 21(1). doi:10.1186/s12864-019-6413-7
  2. Ehteshami Bejnordi, B., Veta, M., Johannes van Diest, P., van Ginneken, B., Karssemeijer, N., Litjens, G., van der Laak, J. A. W. M., and the CAMELYON16 Consortium, Hermsen, M., Manson, Q. F., Balkenhol, M., Geessink, O., Stathonikos, N., van Dijk, M. C., Bult, P., Beca, F., Beck, A. H., Wang, D., Khosla, A., & ... Venâncio, R. (2017). Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer. JAMA, 318(22), 2199. doi:10.1001/jama.2017.14585
  3. Ting, D. S. W., Cheung, C. Y. L., Lim, G., Tan, G. S. W., Quang, N. D., Gan, A., Hamzah, H., Garcia-Franco, R., San Yeo, I. Y., Lee, S. Y., Wong, E. Y. M., Sabanayagam, C., Baskaran, M., Ibrahim, F., Tan, N. C., Finkelstein, E. A., Lamoureux, E. L., Wong, I. Y., Bressler, N. M., & ... Wong, T. Y. (2017). Development and Validation of a Deep Learning System for Diabetic Retinopathy and Related Eye Diseases Using Retinal Images From Multiethnic Populations With Diabetes. JAMA, 318(22), 2211. doi:10.1001/jama.2017.18152
  4. Khanam, J. J., & Foo, S. Y. (2021). A comparison of machine learning algorithms for diabetes prediction. ICT Express, 7(4), 432-439. doi:10.1016/j.icte.2021.02.004
  5. Parker, J. S., Mullins, M., Cheang, M. C. U., Leung, S., Voduc, D., Vickery, T., Davies, S., Fauron, C., He, X., Hu, Z., Quackenbush, J. F., Stijleman, I. J., Palazzo, J., Marron, J. S., Nobel, A. B., Mardis, E., Nielsen, T. O., Ellis, M. J., Perou, C. M., & Bernard, P. S. (2009). Supervised Risk Predictor of Breast Cancer Based on Intrinsic Subtypes. Journal of Clinical Oncology, 27(8), 1160-1167. doi:10.1200/jco.2008.18.1370
  6. Uddin, S., Khan, A., Hossain, M. E., & Moni, M. A. (2019). Comparing different supervised machine learning algorithms for disease prediction. BMC Medical Informatics and Decision Making, 19(1). doi:10.1186/s12911-019-1004-8
  7. Alzubaidi, L., Zhang, J., Humaidi, A. J., Al-Dujaili, A., Duan, Y., Al-Shamma, O., Santamaría, J., Fadhel, M. A., Al-Amidie, M., & Farhan, L. (2021). Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. Journal of Big Data, 8(1). doi:10.1186/s40537-021-00444-8
  8. Zhou, Z. H. (2018). A brief introduction to weakly supervised learning. National Science Review, 5(1), 44-53. doi:10.1093/nsr/nwx106
  9. Shorten, C., Khoshgoftaar, T. M., & Furht, B. (2021). Text Data Augmentation for Deep Learning. Journal of Big Data, 8(1). doi:10.1186/s40537-021-00492-0
  10. Geurts, P., Irrthum, A., & Wehenkel, L. (2009). Supervised learning with decision tree-based methods in computational and systems biology. Molecular BioSystems, 5(12), 1593-1605. doi:10.1039/b907946g
  11. Jordan, M. I., & Rumelhart, D. E. (1992). Forward Models: Supervised Learning with a Distal Teacher. Cognitive Science, 16(3), 307-354. doi:10.1207/s15516709cog1603_1
  12. Figueiredo, M. A. T. (2003). Adaptive sparseness for supervised learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(9), 1150-1159. doi:10.1109/tpami.2003.1227989
  13. Esteva, A., Kuprel, B., Novoa, R. A., Ko, J., Swetter, S. M., Blau, H. M., & Thrun, S. (2017). Dermatologist-level classification of skin cancer with deep neural networks. Nature, 542(7639), 115-118. doi:10.1038/nature21056
  14. Churches, C. E., Wampler, P. J., Sun, W., & Smith, A. J. (2014). Evaluation of forest cover estimates for Haiti using supervised classification of Landsat data. International Journal of Applied Earth Observation and Geoinformation, 30, 203-216. doi:10.1016/j.jag.2014.01.020
  15. Soares, J. V. B., Leandro, J. J. G., Cesar, R. M., Jelinek, H. F., & Cree, M. J. (2006). Retinal vessel segmentation using the 2-D Gabor wavelet and supervised classification. IEEE Transactions on Medical Imaging, 25(9), 1214-1222. doi:10.1109/tmi.2006.879967
  16. Dubath, P., Rimoldini, L., Süveges, M., Blomme, J., López, M., Sarro, L. M., De Ridder, J., Cuypers, J., Guy, L., Lecoeur, I., Nienartowicz, K., Jan, A., Beck, M., Mowlavi, N., De Cat, P., Lebzelter, T., & Eyer, L. (2011). Random forest automated supervised classification of Hipparcos periodic variable stars: Classification of Hipparcos periodic stars. Monthly Notices of the Royal Astronomical Society, 414(3), 2602-2617. doi:10.1111/j.1365-2966.2011.18575.x
  17. Dietterich, T. G. (1998). Approximate Statistical Tests for Comparing Supervised Classification Learning Algorithms. Neural Computation, 10(7), 1895-1923. doi:10.1162/089976698300017197
  18. Alpaydm, E. (1999). Combined 5 × 2 cv F Test for Comparing Supervised Classification Learning Algorithms. Neural Computation, 11(8), 1885-1892. doi:10.1162/089976699300016007
  19. van Engelen, J. E., & Hoos, H. H. (2020). A survey on semi-supervised learning. Machine Learning, 109(2), 373-440. doi:10.1007/s10994-019-05855-6
  20. Sohn, K., Berthelot, D., Li, C., Zhang, Z., Carlini, N., Cubuk, E. D., Kurakin, A., Zhang, H., & Raffel, C. (2020). FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence. arXiv. doi:10.48550/arxiv.2001.07685 Free full text
  21. Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., & Raffel, C. (2019). MixMatch: A Holistic Approach to Semi-Supervised Learning. arXiv. doi:10.48550/arxiv.1905.02249 Free full text
  22. Li, J., Socher, R., & Hoi, S. C. H. (2020). DivideMix: Learning with Noisy Labels as Semi-supervised Learning. arXiv. doi:10.48550/arxiv.2002.07394 Free full text
  23. Batista, G. E. A. P. A., & Monard, M. C. (2003). An analysis of four missing data treatment methods for supervised learning. Applied Artificial Intelligence, 17(5-6), 519-533. doi:10.1080/713827181
  24. Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., & Krishnan, D. (2020). Supervised Contrastive Learning. arXiv. doi:10.48550/arxiv.2004.11362 Free full text
  25. Žbontar, J., Jing, L., Misra, I., LeCun, Y., & Deny, S. (2021). Barlow Twins: Self-Supervised Learning via Redundancy Reduction. arXiv. doi:10.48550/arxiv.2103.03230 Free full text
  26. Tin Kam Ho, & Basu, M. (2002). Complexity measures of supervised classification problems. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(3), 289-300. doi:10.1109/34.990132
  27. Jimenez, L. O., & Landgrebe, D. A. (1998). Supervised classification in high-dimensional space: geometrical, statistical, and asymptotical properties of multivariate data. IEEE Transactions on Systems, Man and Cybernetics, Part C (Applications and Reviews), 28(1), 39-54. doi:10.1109/5326.661089
  28. Dramiński, M., Rada-Iglesias, A., Enroth, S., Wadelius, C., Koronacki, J., & Komorowski, J. (2008). Monte Carlo feature selection for supervised classification. Bioinformatics, 24(1), 110-117. doi:10.1093/bioinformatics/btm486
  29. Zenke, F., & Ganguli, S. (2018). SuperSpike: Supervised Learning in Multilayer Spiking Neural Networks. Neural Computation, 30(6), 1514-1541. doi:10.1162/neco_a_01086
  30. Ponulak, F., & Kasiński, A. (2010). Supervised Learning in Spiking Neural Networks with ReSuMe: Sequence Learning, Classification, and Spike Shifting. Neural Computation, 22(2), 467-510. doi:10.1162/neco.2009.11-08-901
  31. Sporea, I., & Grüning, A. (2013). Supervised Learning in Multilayer Spiking Neural Networks. Neural Computation, 25(2), 473-509. doi:10.1162/neco_a_00396
  32. Hardt, M., Price, E., & Srebro, N. (2016). Equality of Opportunity in Supervised Learning. arXiv. doi:10.48550/arxiv.1610.02413 Free full text
  33. Burkart, N., & Huber, M. F. (2021). A Survey on the Explainability of Supervised Machine Learning. Journal of Artificial Intelligence Research, 70, 245-317. doi:10.1613/jair.1.12228
  34. Apley, D. W., & Zhu, J. (2020). Visualizing the Effects of Predictor Variables in Black Box Supervised Learning Models. Journal of the Royal Statistical Society Series B: Statistical Methodology, 82(4), 1059-1086. doi:10.1111/rssb.12377
  35. Oliver, A., Odena, A., Raffel, C., Cubuk, E. D., & Goodfellow, I. (2018). Realistic Evaluation of Deep Semi-Supervised Learning Algorithms. arXiv. doi:10.48550/arxiv.1804.09170 Free full text

Cite this page: Atlas Nova editors. (2026). Supervised learning. Atlas Nova. https://velocer.io/atlas/supervised-learning/