10  Machine learning

Machine learning builds models that make predictions from data. Rather than writing down a mathematical model of how the data arose, we let an algorithm search for patterns that predict well, and then check those predictions against data the algorithm never saw.

This chapter covers three kinds of model. The first two are supervised, meaning the algorithm learns from examples whose answers we already know: a classifier predicts which category an observation belongs to, and a regression predicts a number. The third is unsupervised, working without any answers at all and instead looking for structure that is already present in the data.

10.1 Classification

10.1.1 Features and labels

10.1.2 A first classifier: k-Nearest Neighbors

10.1.3 How good is the classifier? Cross-validation

10.1.4 Feature normalization

10.1.5 Other classifiers

10.2 Linear regression

10.2.1 Fitting a line to data

10.2.2 Interpreting the model

10.2.3 Inference on regression coefficients

10.3 Unsupervised learning

10.3.1 Clustering

10.3.2 Hierarchical clustering

10.4 Summary

10.5 Exercises