Skip to content

Practice: Statistics in machine learning

This is the capstone practice, so it is about integration: pulling the whole track together to read a real AI claim, and knowing exactly where this track’s job ends and the modeling track’s begins.

Six short questions. Answer each in your head before opening the collapsible.

1. Why is evaluating a model a problem of statistical inference?

Show answer

Because the test set is a sample, so the measured metric (accuracy, etc.) is a statistic estimating the true value on all future data. It has a standard error, deserves a confidence interval, and comparing two models is a hypothesis test. Evaluation is inference: from a sample to the truth.

2. Name the four questions to ask of any “our model is X% accurate and significantly better” claim.

Show answer

(1) On how large a test set, and what is the confidence interval? (2) Is the difference statistically significant given that sample size? (3) Is X% even good, given the base rate / class balance? (4) Is the improvement meaningful (effect size), not just significant? Together they turn a settled-sounding number into something judgeable.

3. Where does a model’s output as a “conditional probability” fit, and which lesson is it from?

Show answer

A classifier estimates P(label given the inputs), a conditional probability (lesson 6). Reading a model output means reading a conditional probability, and combining it with the base rate (Bayes) to know what it really implies.

4. What does this track deliberately hand off to the Classical Machine Learning track?

Show answer

The toolkit for scoring a trained classifier: the confusion matrix, precision and recall, ROC and AUC curves, and the bias-variance tradeoff. Those build on this track’s inference ideas but belong to the modeling track’s model-evaluation phase. This track gives the statistical-thinking layer underneath.

5. How does the expected value connect to how a model is trained?

Show answer

Training minimizes an expected error (the loss) or maximizes an expected reward (lesson 8). “Minimize the loss” and “maximize reward” are both expected-value statements, the long-run average of a quantity that depends on which data the model sees.

6. State the track’s through-line in one sentence.

Show answer

Statistics is the discipline of not fooling yourself about uncertainty, and in the age of AI, which automates inference at scale, that discipline is how you tell a system that genuinely works from one that only looks like it does.

A startup announces: “Our fraud-detection model is 99.5% accurate and beats the previous model’s 99.2%, tested on last week’s transactions.” Using the track’s tools, what questions and cautions would you raise? Jot them down, then check.

Show answer
  • Base rate first (lessons 1, 7). Fraud is rare, often well under 1% of transactions. A model that flags nothing is already about 99% “accurate,” so 99.5% accuracy may be near-worthless. Accuracy is the wrong headline metric for a rare target; you would want to know how it does on the fraud cases specifically.
  • The metric itself. Because of the imbalance, raw accuracy hides performance on the rare class. (The specific metrics that fix this, precision, recall, ROC, live in the Classical ML track, but this track tells you to be suspicious of bare accuracy on imbalanced data.)
  • Confidence interval (lessons 11, 12). “Tested on last week’s transactions” is a sample. How many fraud cases did it actually contain? If few, both accuracy numbers carry wide intervals and 99.5% is a shaky estimate.
  • Significance of the gap (lesson 13). Is 99.5% vs 99.2% a real improvement or noise? With few fraud cases in the test, that 0.3-point gap is likely within the noise; it needs a hypothesis test, not a comparison of point estimates.
  • Meaningful vs significant (lesson 13). Even if real, is a 0.3-point gain worth the cost and risk of shipping a new model? Significant is not the same as worthwhile.

One announced sentence, five cautions, none of which require the modeling track, only the statistical thinking from this one.

For each item, say whether it belongs to this track (statistical thinking) or the Classical Machine Learning track (the model-scoring toolkit).

A. Putting a confidence interval on a model's measured accuracy.
B. Reading a confusion matrix.
C. Running a hypothesis test on whether model B beats model A.
D. Drawing and interpreting an ROC curve.
E. Reasoning about base rates when a rare-event detector fires.
F. The bias-variance tradeoff.
G. Treating the train/test split as a sampling problem.
Show answer
  • This track: A (confidence intervals, lesson 12), C (hypothesis testing, lesson 13), E (base rates, lessons 1 and 7), G (sampling, lesson 11).
  • Classical Machine Learning track: B (confusion matrix), D (ROC curve), F (bias-variance tradeoff).

The dividing line: this track gives the statistical reasoning about estimates, uncertainty, and inference that applies to any system; the modeling track gives the specific machinery for scoring a classifier. They fit together, with this track as the foundation underneath.

Eight cards. Click any card to reveal the answer. Use the Print flashcards button to lay out the full set as one card per page for offline review.

Q. Why is model evaluation a problem of statistical inference?
A.

The test set is a sample, so a metric is a statistic estimating the true value, with a standard error. It deserves a confidence interval, and comparing models is a hypothesis test.

Q. What four questions should you ask of a model accuracy claim?
A.

On how large a test set (confidence interval)? Is the difference significant at that sample size? Is the accuracy good given the base rate? Is the improvement meaningful (effect size), not just significant?

Q. Where do the track's tools fit in the ML workflow?
A.

Describe data before modeling (center/spread, shape, correlation); read outputs as conditional probabilities; train toward an expected value (loss/reward); evaluate as inference (sample, interval, test).

Q. What does this track hand off to the Classical ML track?
A.

The model-scoring toolkit: confusion matrix, precision/recall, ROC/AUC, and the bias-variance tradeoff. They build on this track’s inference ideas but belong to the modeling track.

Q. Why is raw accuracy a poor headline metric for a rare-event detector?
A.

Because of the base rate: if the target is rare, a model that always predicts the majority class scores high while detecting nothing. High accuracy can be near-worthless on imbalanced data.

Q. How is a model's output a conditional probability?
A.

A classifier estimates P(label given the inputs). Reading the output means reading a conditional probability and combining it with the base rate (Bayes) to know what it implies.

Q. How does expected value connect to training a model?
A.

Training minimizes an expected error (the loss) or maximizes an expected reward. Both are expected-value statements: the long-run average of a quantity depending on the data seen.

Q. What is the track's one-sentence through-line?
A.

Statistics is the discipline of not fooling yourself about uncertainty, which in the age of AI is how you tell a system that genuinely works from one that only looks like it does.