Intermediate Pro Subscription Required

Machine Learning Foundations: Predict, Test and Decide Honestly

Learn what machine learning really is by building it by hand on a courier company's trips. Beat a do-nothing baseline, split data honestly, fit a straight line, judge yes-or-no predictions with a confusion matrix, choose thresholds by cost, build nearest neighbours, catch overfitting and find a leak, then write one function that evaluates a model and decides whether to ship it. Every lab runs real NumPy and pandas in your browser (the same Python and pandas runtime as Python for Data, nothing extra to download), and every dataset is generated for you alone.

4-6 hours of study Builds toward: ML Practitioner 9 modules

Practise on your own computer

The labs in the lessons run in your browser. To repeat them, go further and try the capstone on your own machine, set up the environment with these free guides:

Most machine learning failures are not failures of mathematics. A model is graded on the data it learned from. A score is quoted with no baseline. A column that only exists after the event sneaks into the inputs. A threshold is a round number nobody questioned. The people who avoid these mistakes are not cleverer; they have a habit of honest evaluation.

This is the fourth season of Sabi Logistics’ story. A vendor wants a three-year contract for an “AI” that predicts delivery times, and Chidi, Ngozi, Emeka and Amara decide to find out what is really possible with their own trips. You build every model by hand with NumPy and pandas, so you see exactly what a library such as scikit-learn does for you, and the labs need no extra download beyond the Python and pandas you already used. Each case gives you a file generated for you alone, a script to complete and answers checked against what the data really says.

What you will learn

  1. The baseline: what a model that knows nothing scores, and why every result needs one.
  2. An honest split: training and test data, splitting by time, and how leakage flatters a score.
  3. A straight line: linear regression, the slope as a rate, R squared, and several inputs at once.
  4. Right or wrong: the confusion matrix, accuracy and why it can mislead.
  5. The cost of errors: precision, recall, F1 and a threshold chosen in naira.
  6. Nearest neighbours: a second kind of model, scaling features and choosing k.
  7. Too clever by half: overfitting, and why training error cannot choose a model.
  8. The leak: columns that are not known when the decision is made.
  9. The model card: one reproducible evaluation that is allowed to say “do not ship”.

A graded capstone and an exam finish the course. Two free guides show how to set up Python, NumPy, pandas and scikit-learn on your own computer and repeat each case with the real libraries.