Machine Learning Foundations

Course Content

Machine Learning Foundations

14 sections · 70 lessons

What kind of problems are best solved using supervised learning?


What you need to know

The shape of a supervised problem

A problem is a good supervised fit when you can fill in this sentence: "Given ___ that I know now, predict ___ that I will only know later, and I have many past cases where I know both."

  • Given an applicant's income and credit history, predict whether they default in the next 12 months.
  • Given a flat's area, locality and age, predict its sale price.
  • Given an email's text and sender, predict whether a user will mark it as spam.
  1. A clear target — "churn" must be defined exactly, for example "no recharge for 60 days". Vague targets give vague models.
  2. Enough labelled history — hundreds of examples per class at minimum, thousands to be comfortable, and enough of the rare class.
  3. Features available at prediction time — you cannot use "number of recovery calls" to predict default, because those calls happen after the default.
  4. A stable world — patterns from last year must still hold. A model trained before a policy change may be useless after it.
  5. An action — someone will do something with the prediction, such as call the customer or hold the payment.

Common supervised use cases

ProblemTypeLabel comes from
Loan defaultClassificationRepayment records
Spam detectionClassificationUsers pressing "report spam"
Telecom churnClassificationAccount closures and port-outs
Flat price in BengaluruRegressionRegistered sale prices
Food delivery ETARegressionActual delivery timestamps
Product demandRegressionPast sales

Notice the last column. The best supervised problems have labels that the business creates for free as a side effect of operating.

When it is not the right fit

  • No labels and no cheap way to get them: start with unsupervised methods, or label a small sample.
  • The event is extremely rare, such as a new fraud type seen 5 times: treat it as anomaly detection.
  • The rules are simple and stable: write plain code.

A real-life example

A microfinance lender asks, "Can ML help us approve loans faster?" The engineer walks the checklist:

  • Target: "90 or more days past due within the first year". Agreed with the risk team.
  • Labels: 60,000 closed loans from 2021 to 2024, with about 7% defaults, so roughly 4,200 positive examples. Enough.
  • Features at prediction time: income, existing loans, credit bureau score, village or ward, loan amount. The team drops "number of collection visits" because it is only known after disbursal.
  • Stability: a 2022 policy change raised the minimum income, so they train on 2022 onward only.

This conversation, done before writing any code, is what separates a working model from one that fails in production.

Follow-up questions to expect

  • "How many labels do I need?" — There is no fixed number. It depends on how noisy the problem is and how many features you have. Train on growing slices of the data and see whether the score is still improving.
  • "What if the positive class is rare?" — Make sure you have enough positives in absolute terms, use stratified splits, and judge with precision and recall rather than accuracy.
  • "What is label leakage?" — Using a feature that contains or is caused by the answer, such as collection visits in a default model. It gives great offline scores and fails live.