Week 1 — Prediction Problems & Data · ~50 min

What machine learning is (and is not)

Free preview

What you'll learn this week

  1. Tell supervised learning from unsupervised learning, and classification from regression from clustering
  2. Name the parts of every prediction problem: observation, feature, label, prediction
  3. Frame a prediction around a decision, a time of prediction and the cost of errors
  4. Pick a simple baseline before you train anything
  5. Inspect a dataset for size, missing data, class balance, provenance and representation
  6. Spot leakage — the most common way a model looks brilliant in a notebook and fails in real life
  7. Ship a written experiment plan for one regression and one classification problem

A model is a function you did not write by hand

In Data Analytics II you wrote rules yourself:

def risk_level(delay, completion_rate):
    if delay > 25 or completion_rate < 0.75:
        return "CRITICAL"
    ...

You chose the thresholds 25 and 0.75. Machine learning flips this around: you give the computer examples with known answers, and it learns the rule (the numbers inside the function) from the data.

Traditional programming:   rules + data      -> answers
Machine learning:          data + answers    -> rules (a model)

That is all "learning" means here: choosing numbers inside a function so that its outputs match known answers as closely as possible. No magic, no understanding — just fitting.

The vocabulary you will use every week

Take a lender in Lagos predicting whether a small-business loan will be repaid.

TermMeaningExample
ObservationOne row — one thing we predict aboutOne loan application
FeatureAn input column the model may useMonthly turnover, years trading, loan amount
Label / targetThe answer we want to predictRepaid (1) or defaulted (0)
PredictionThe model's output for one observation0.83 probability of repayment

Write these four words on every problem you meet. If you cannot say what one observation is, you are not ready to train.

Supervised vs unsupervised

Supervised learning — you have labels. The model learns the mapping from features to label.

  • Regression: the label is a number. How many minutes will this delivery take? What will this flat rent for?
  • Classification: the label is a category. Will this loan default? Is this transaction fraud? Is this tumour malignant?

Unsupervised learning — no labels. The model finds structure on its own.

  • Clustering: group similar observations. Which customers behave alike? Nobody told the model the "right" groups — so nobody can easily tell you whether its groups are right either.

Quick test — which is which?

  1. Predict next month's electricity units for a household → regression (a number)
  2. Decide whether an email is spam → classification (spam / not spam)
  3. Group 5,000 shop customers into segments for marketing → clustering (no label)
  4. Predict which of 4 delivery hubs a parcel will be routed to → classification (4 classes)

What ML is not

  • Not causation. A model that predicts loan default from the applicant's phone brand has found an association. Changing someone's phone will not make them repay.
  • Not a replacement for the question. A perfect model of the wrong target is useless.
  • Not proof on its own training data. A model can memorise the examples it saw. We only trust results on data it never saw — that is the theme of this entire course.

Self-check

  1. In your own words: what is the difference between a feature and a label?
  2. A hospital wants to group patients by similar symptom patterns without any diagnosis column. Supervised or unsupervised?
  3. Give one regression and one classification problem from your own work or city.

Sign in to track your progress.