Standardisation, fit and transform
Standardisation puts numeric features into reference-SD units. Learn its parameters from training data and keep them fixed for later records.
Fit means learn and save parameters from training data. Transform means apply the saved rule to an input without relearning. Split before fitting anything data-dependent.
For A and B only, score mean=75, population SD=5; minutes mean=120, population SD=60. W4 divides by n, matching the teaching scaler convention. This differs from W2's sample SD exercise and is intentional.
A transforms to [-1,-1], B to [1,1], and NEW to [0.8,-1/3]. Distance to A is sqrt(1.8^2+(2/3)^2), about 1.919. Distance to B is sqrt((-0.2)^2+(-4/3)^2), about 1.348. B is nearest again. NEW must not influence the training mean or spread.
Use the saved training rule on training, test and future rows. Fitting a separate test scaler would put the two sets into different reference systems. Fitting one scaler on their union would leak test information into fitting.
Sources: W4 PDF pp. 2-42; L4 Tasks 1-7. All fixed worked values here were recalculated from the supplied examples. These toy rules are teaching devices, not deployable student-support recommendations.
The same raw score gets different z-scores when the reference changes. This lab uses sample SD (ddof=1); the Week 4 prediction scaler uses training-only population-style SD (ddof=0).
The training rows supply every replacement and scaling value. Filling a gap lets the model run, but does not recover the true measurement.
The lab uses three scaled numbers followed by three programme indicators. This fixed layout tells the distance calculation what to compare.
Practice problems
Supplementary study questions on the lecture concepts — not verbatim exam questions. Each answer counts toward spaced review.
1. Conceptual understanding
Definitions and distinctions.
What does fit learn for standardisation?
Training values [60,60,80,80] have which scaling parameters using ddof=0?
2. Application
Apply the concept to a case or calculation.
Saved mean=20 and SD=5. What does value 10 transform to?
Which values should determine scaling parameters in this workflow?
3. Interpretation and limitations
Evaluate assumptions and justify conclusions.
On the same fitted data and SD convention, a nonconstant standardised column has approximately what mean and SD?
A new group's transformed scores have mean 0.6. Does this automatically mean a bug?
Explain it in writing
Self-checked, not marked. Write a few sentences, then compare with the example answer. Your writing is saved as you type.
Show an example answer
The lecture scaler uses population-style SD with divisor n. Sample SD uses n−1 and produces different transformed values, so follow the stated convention.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?
Show an example answer
No. Those properties describe the fitted reference data under the same rule and convention. A new group's distribution can be different.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?