Support the missionKeep the lab open and growing

Machine Learning Essentials

What it is. Machine learning builds systems that learn from examples rather than rules. Its central idea is the bias-variance trade-off: how much to trust the data you have when predicting the data you will meet. A few methods, neighbours, regularized least squares, kernels, sparsity and principal components, cover the core.

What it gives you. It gives you the questions to ask of any data-driven claim: how many examples, how noisy, how was it checked on new data, and which variables really matter.

Learning from examples

Supervised learning starts with examples of inputs and correct outputs, such as images labelled face or not. The goal is not to describe those examples but to predict new ones. An image becomes a long list of pixel values, and the art lies in choosing that representation.

The simplest method copies the label of the nearest stored example. It makes no errors on its training data, yet its boundaries jump with each new small dataset: it is unstable. Voting among the k nearest neighbours smooths the answer; too many voters and it ignores detail.

That is the bias-variance trade-off. Variance is instability, which falls as more is averaged. Bias is blurring, which grows. The best balance depends on how much data there is, how noisy it is and how complex the true pattern is.

Three families

Six points

Rules of thumb

Prediction is not explanation

  1. In medicine, a model may sort patients into two disease types.
  2. Clinicians also want to know which measurements drove the answer.
  3. Sparse models answer by setting most weights to zero.
  4. Correlated measurements make the choice of variables ambiguous.
  5. A short list of variables is then a lead to investigate, not a final answer.

A good model predicts. A useful one also points to why.

Who invented least squares, Gauss or Legendre, has been argued over in long articles for two centuries.

Steps

  1. Toss a coin 10 times and count heads.
  2. Then toss it 50 more times and count again.
  3. Ten tosses can look unfair; many tosses settle near half. Small samples mislead. This is why models must not trust few data too much.
  4. Think of a rule of thumb you formed from two or three experiences.
  5. It fits your examples perfectly and may fail on the next one. Machine learning calls this overfitting.
  6. Ask of any prediction you read: was it tested on data it never saw?
  7. Holding back data to test on, called cross-validation, is the basic check of any learned model.

Time. 10 minutes

Words to know

Overfitting
Fitting the training data so closely, noise included, that predictions on new data get worse.
Cross-validation
Testing a model on data held back from training, to estimate how it will do on new data.
Regularization
Adding a penalty that keeps a model simple and stable, at the cost of fitting the data less exactly.
Principal component analysis
Finding the directions along which data vary most, to compress or visualise them.

Summarized by Irina Medelye · IRA X LAB.

More in Brains, Minds and Machines