Overview

Appendix. Machine learning refresher

This appendix provides a practical refresher on machine learning concepts that matter most for human-in-the-loop systems. It emphasizes how models produce predicted labels along with numeric values attached to those labels, and warns that these numbers are often labeled inconsistently across tools as scores, confidences, or probabilities. The key takeaway is that users should not assume the name tells the truth; instead, they should check the documentation and understand what the model output really represents before using it for decisions or sampling.

A major focus is softmax, since it is the most common way neural network outputs are turned into probability-like distributions. The text explains that softmax converts raw model outputs into values between 0 and 1 that sum to 1, but this transformation is lossy and can distort uncertainty. It also shows that the choice of base or temperature changes how concentrated or spread out the probabilities become, can affect the rank order of confidence between items, and may even cause overflow with large inputs unless the values are stabilized. Because of this, softmax outputs are useful, but they should be interpreted carefully, especially when choosing uncertain examples for active learning.

The appendix also reviews evaluation metrics for human-in-the-loop machine learning, including precision, recall, F-score, micro and macro averaging, chance-adjusted accuracy, and AUC. It explains why plain accuracy can be misleading when labels are imbalanced, why chance-adjusted measures help with random-baseline effects, and why AUC is valuable when confidence matters as much as the predicted label itself. Finally, it broadens evaluation beyond model performance to system performance, stressing measures such as the number of errors caught by humans and the labor saved through active learning or better annotation workflows, since the real goal is often to improve the combined human-machine process rather than model accuracy alone.

Figure A.1 How softmax creates probability distributions in two types of architectures. In the top example, softmax is the activation function of the output (final) layer, directly outputting a probability distribution. In the bottom example, a linear activation function is used on the output layer, creating model scores (logits) that are converted to probability distributions via softmax. The bottom architecture is only slightly more complicated but is preferred for active learning, as it is more informative.
Figure A.2 Graph showing e as its own integral. The slope at f(1) = 1 is 1, the slope at f(2) = 2 is 2, and so on.
Figure A.3 Comparing two bases for exponentials (e and 10) for softmax on the same raw output data from a model. The graphs show that the higher the base, the higher the estimated probability of the highest score, with the highest score dominating the softmax equation to a greater extent at higher bases.
Figure A.4 Comparing the inputs in table A.3 (A = [3.22, 2.88, 3.03, 3.09] and B = [3.25, 3.24, 3.23, 1.45]) with different softmax bases and different temperature, showing either set of inputs could have the most confident result depending on the base or temperature. Strictly, the x-axis in the bottom graph is the inverse temperature, which is an valid equally scaling metric, although not as common. We use the inverse here to show both graphs going up and to the right in more or less the same way.
Figure A.5 Softmax equivalencies: four model scores that give identical probability distributions under softmax. The four softmax probability distributions are identical despite coming from different model scores, showing that only the differences between the scores matter. The scores of (1, 4, 2, 3), for example, give the same probability distribution under softmax as (101, 104, 102, 103).
Figure A.6 Two score distributions are identical except for scale. The right scores are 10 times the left scores. Under softmax, these scores result in different probability distributions. This figure also shows the result of changing the temperature rather than the base. If we start with the values on the left but lower the temperature to 0.1 (effectively multiplying the logits by 10), we get more weight going to the most confident predictions.
Figure A.7 An example ROC curve, plotting TPR against FPR in an order determined by model confidence. In this example, we see that the line of the ROC curve is near vertical for the first 20%. This line tells us that for the 20% most confident predictions, we are almost 100% accurate. The ROC curve is almost horizontal at 1.0 for the final 30%. This line tells us that by the time we get to the 30% least confident predictions for a label, few items with that label remain.
Figure A.8 The reduction in labels is needed. In this example, the strategy that uses active learning (chapters 3–6) reaches the same accuracy as random sampling with fewer than half as many labels. B / (a + b) = 53% reduction in labels needed.

FAQ

What does a supervised machine learning model usually output?A supervised model usually returns two things: a predicted label (or set of labels) and a number or set of numbers associated with each label, often interpreted as scores, confidence values, or probabilities.
What is a probability distribution in the context of model predictions?In this context, a probability distribution means the predicted scores across labels add up to 1.0 (or 100%). It does not necessarily mean the model’s outputs are true statistical probabilities.
Why shouldn’t you trust the names “score,” “confidence,” and “probability” in ML libraries?ML libraries often use these terms inconsistently, sometimes interchangeably. You should read the documentation to understand what the values actually represent rather than relying on the label alone.
What is softmax used for in machine learning?Softmax converts raw model outputs, called logits, into a probability-like distribution over labels. It maps arbitrary real-valued scores into values between 0 and 1 that sum to 1.
Why is softmax considered lossy?Softmax is lossy because it removes information about the original scale of the scores and can hide whether uncertainty came from weak evidence or from competing evidence among labels.
How does changing the softmax base or temperature affect predictions?Changing the base or temperature changes how spread out or polarized the probability distribution becomes. A higher base or lower temperature makes the top prediction dominate more strongly, and it can even change the rank order of confidence between items.
Why does adding the same constant to all logits not change softmax output?Softmax depends on relative differences between scores, not their absolute values. So adding the same constant to every score leaves the resulting probability distribution unchanged.
How do precision, recall, and F-score differ?Precision measures how many predicted positives are correct, recall measures how many actual positives are found, and F-score is the harmonic mean of precision and recall. These metrics help evaluate performance for a specific label.
What is chance-adjusted accuracy?Chance-adjusted accuracy scales performance so that random guessing counts as 0 rather than a positive score. It is useful when label frequencies are uneven or when you want to account for baseline chance performance.
What does AUC measure in a model?AUC, or area under the ROC curve, measures how well model confidence ranks correct items above incorrect ones. It reflects the probability that a randomly chosen positive item is assigned higher confidence than a randomly chosen negative item.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Human-in-the-Loop Machine Learning Human-in-the-Loop Machine Learning ebook for free