Read the question, then do the math
A question can look unfamiliar because several familiar operations have been packed into one line. Start by identifying the objects, the assumptions, and the requested output. Try each problem before opening its walkthrough.
A conditional-error question
Section titled “A conditional-error question”Question. Let , where and . For , compute
You are being asked for one number. The condition after the vertical bar fixes . The outer expectation averages the squared error over the remaining randomness in .
1. Decode what you were given
- : epsilon is independent of X. Fixing X does not change its distribution.
- : the noise is uniform on that interval. Its mean is zero and variance is .
- : the prediction rule you must evaluate, not the true conditional mean.
- : set X to one-half, then average over the noise.
2. Substitute before expanding
So the random error is . The question has become: what is the average square of one-eighth plus this noise?
3. Square and average
Why does ? Variance is , and the mean is zero.
Check the answer: it is above , the expected error of guessing the conditional mean. The extra is the squared miss of our rival prediction.
An argmin question
Section titled “An argmin question”Question. For observations , , and , find
Decode the question
means you may choose any real number. The sum scores that choice on the three observations. Argmin asks for the winning choice of c, not its score. The star labels the optimal choice; it is not multiplication.
Solve and distinguish the two answers
The mean minimizes squared error, so .
The minimum score is . An answer of 18 would answer “what is the minimum?” rather than “which c achieves it?”
Change the loss to and the optimal choice becomes the median, 0. Always read the scoring rule.
An expectation over training datasets
Section titled “An expectation over training datasets”Question. At , , , , and . Assume independent training and future examples. Find the expected squared prediction error at .
What is random this time?
The input is fixed. The dataset subscript D means we repeatedly draw training datasets, fit a model to each, and inspect its prediction at . There is also fresh output noise. The variance of the predictions (2) and the variance of the outputs around f (3) refer to different experiments.
Work the three terms
Bias is . Squared bias is 1. Add prediction variance and noise variance: .
This is a theoretical average over datasets and fresh outputs. It does not say that the MSE on your next finite test set will equal 6.
A vector calculation
Section titled “A vector calculation”Question. Let , , and . Evaluate .
Translate and calculate
The transpose symbol turns the coefficient column into a row so the product is a dot product. Multiply corresponding entries and add:
There are two features in this one example. These are not two training rows.
What does zero mean actually give you?
Section titled “What does zero mean actually give you?”Question. Let , with finite means and . Must ?
Separate the overall average from the conditional average
Conditioning gives
The given overall average does not determine the average within each input group. For example, let X be equally likely to be −1 or 1, and let . The noise has overall mean zero, but , so .
We need zero conditional mean, . Independence of X and ε together with zero overall noise mean would also be sufficient. Zero overall mean alone is not.
Try a new question
Section titled “Try a new question”Mixed practice changes the numbers and the kind of question. Start without a hint; if needed, reveal a translation before the worked answer.