§5.1.3 The experience, E
What the algorithm gets to see splits machine learning into its two broad families. Unsupervised algorithms experience a dataset of features and learn useful properties of its structure — in deep learning, usually the whole distribution (explicitly, as density estimation, or implicitly, for synthesis and denoising), or other roles like clustering. Supervised algorithms additionally see a label (or target) with each example — learning to predict from , usually by estimating . The name pictures an instructor showing the system what to do; unsupervised learning has no teacher.
The classic Iris dataset (Fisher, 1936) illustrates both: 150 plants, four measurements each (sepal length/width, petal length/width) — and a species annotation that turns it supervised.
Aside — the blurred line
The two families are not formally distinct. The chain rule (, eq 5.1) splits the “unsupervised” problem of modeling into supervised prediction problems; and the “supervised” can be recovered from unsupervised modeling of the joint via (eq 5.2). Other variants exist too: semi-supervised (some targets missing), multi-instance (only collections labeled), and reinforcement learning (a feedback loop with an environment — outside this book’s scope).
Most datasets are described by the design matrix design matrix X ∈ ℝ^{m×n} stacking one example per row: X_{i,:} = (x⁽ⁱ⁾)ᵀ. defined in ch. 2 — open in glossary : one example per row, one feature per column — Iris is , with the sepal length of plant . (When examples have different sizes — photos of different resolutions — we fall back to a set ; chs. 9–10 handle such data.) Supervised datasets add a label vector with the label of example (labels can be richer — a whole sentence for speech transcription).
§5.1.4 Example: linear regression
The abstract definition, made concrete by the simplest interesting learner. Task T: predict scalar from by outputting
Term by term
| the PARAMETERS — weights deciding how each feature affects the prediction: positive weight = feature pushes ŷ up; large magnitude = large effect; zero = no effect | n×1 | |
| the model’s prediction of y — a linear function of the input | scalar |
Measure P: mean squared error on a held-out test set, — zero exactly when predictions equal targets, growing with their Euclidean distance. Experience E: a training set . The algorithm: minimize (justified properly by maximum likelihood in §5.5) — and for this model the minimum has a closed form:
step 1/5: The MSE is a convex quadratic bowl in w — its minimum is exactly where the gradient vanishes (§4.3: solve ∇f = 0 directly instead of iterating).
MSE = 0.229
red segments: the residuals whose squares the MSE averages
Aside — the bias parameter
“Linear regression” usually means the affine model : still linear in the parameters, but the line no longer must pass through the origin. The intercept is called the bias parameter — the output is biased toward absent any input. (Distinct from a statistical bias, §5.4.2!) Trick: instead of adding , append a constant feature 1 to — its weight plays the role of . The book says “linear” for affine throughout.
Linear regression is limited, but it is a complete T/P/E loop with a provably optimal learner — the reference point for every principle that follows: capacity, overfitting and underfitting.
Check yourself — experience and linear regression
1.Why does the book call the supervised/unsupervised line 'blurred'?
2.In the design matrix X ∈ ℝ¹⁵⁰ˣ⁴ for Iris, what are rows and columns — and when does the design-matrix description fail?
3.In LinRegLab you press 'solve normal equations'. What just happened, mathematically?
4.What does the 'bias parameter' b do, and how does it differ from statistical bias?
5.Which learning paradigm involves a feedback loop with an environment rather than a fixed dataset?