1. Courses
  2. Data

Data line, station 5 of 6

Data Science and Machine Learning

Frame business problems as models, build them with Python and scikit-learn, and prove they beat a simple rule.

  • 6lessons
  • 3.5 hto read and do
  • Intermediatelevel
  • 6podcast episodes
  • 6checked exercises
Start the courseCheck what you know

Tools you'll use in this course

The lessons open these with a template ready. They work for your own job too, no course needed.

About this course

Machine learning is useful when it makes a decision better than the rule people use today. This course teaches the full loop: framing a problem as a prediction someone will act on, building features without leaking the future, training and comparing models against a baseline, forecasting demand, predicting churn with a threshold set by costs, and explaining a model's behaviour, errors and limits to the people who use it.

You work on three Mangrove Market problems with Tomás, the data analyst moving into data science: forecasting demand per store and product to cut the 9% of app orders that lose an item to an empty shelf, predicting which app customers will stop ordering and who should get a win-back coupon, and flagging unusual partner orders, where a plain rule turns out to be the right answer. Every model is compared with today's ordering rule on a time-based backtest, and every result is translated into stock-outs, waste and money.

Each lesson shows the pandas and scikit-learn code you would write in a notebook, then gives you auto-checked SQL and JavaScript exercises that run in your browser: leakage-free features with window functions, error measures, confusion matrices and threshold choice, and error analysis by segment. A podcast episode, flashcards and practice tasks with model answers come with every lesson.

What you will be able to do

  • Frame a business problem as a prediction with a clear decision, target, metric pair and baseline
  • Build features from orders and stock and split data by time without leaking the future
  • Train, tune and compare linear, tree and gradient boosting models against a simple baseline
  • Forecast demand through seasonality and festivals, measure forecast error and bias per store, and order from quantiles
  • Predict churn, read precision and recall, and choose a threshold from the costs of each error
  • Explain a model's behaviour, errors and fairness to non-specialists, and say when not to use ML

Syllabus

6 stops, about 3.5 h in total. Each stop fills in when you complete the lesson.

  1. Framing a problem as a model

    Leadership asks for "AI to fix out-of-stocks". Before any model exists, someone has to say which decision it will change, what exactly it predicts, how it will be judged and what it has to beat. This lesson turns that request into a one-page framing you can defend, and shows you how to tell when a better rule is the honest answer.

    35 minIntermediateEpisode1 exercise

    Model evaluationForecastingPython

  2. Features and leakage

    A model can only use what you know at the moment you predict. This lesson shows you how to build demand features from sales, stock, promotions and the festival calendar, how to find the leaks that make a model look brilliant on your laptop and fail in the stores, and how to test it on time the way it will be used.

    35 minIntermediateEpisode1 exercise

    Feature engineeringpandasModel evaluation

  3. Training and comparing models

    You have a framed problem and honest features. This lesson trains four kinds of model on them with scikit-learn (a regularised linear model, a decision tree, a random forest and gradient boosting), shows you how to read under- and overfitting from two numbers, and walks through a comparison against the baseline that you could defend in front of the people who will order stock from it.

    35 minIntermediateEpisode1 exercise

    scikit-learnModel evaluationPython

  4. Forecasting demand

    A demand forecast is useful only when it turns into a good order. This lesson shows you what grocery demand is made of, how to teach a model about festivals that move every year, which error measure to trust, and how to forecast a percentile instead of a single number so the order balances empty shelves against waste.

    35 minIntermediateEpisode1 exercise

    ForecastingModel evaluationpandas

  5. Classification and churn

    Some customers quietly stop ordering, and nobody tells you. This lesson shows you how to define churn when there is no subscription to cancel, train a classifier that gives each customer a probability, judge it properly when only 18% of customers churn, and choose who gets a coupon from what each mistake costs.

    35 minIntermediateEpisode1 exercise

    ClassificationModel evaluationscikit-learn

  6. Explaining and choosing models

    A model that beats the baseline on average can still fail the stores that need it most, or be the wrong tool for the job. This lesson shows you how to explain what a model learned, find where it goes wrong, check who carries its errors, and decide, in writing, whether a model, a rule, an LLM or nothing should ship.

    35 minIntermediateEpisode1 exercise

    Model evaluationFeature engineeringscikit-learn

  7. Capstone: Forecast demand to cut out-of-stocks

    A realistic project with a rubric and a model answer.

  8. Final exam and certificate

    10 questions drawn at random, 70% to pass.

Capstone project

Forecast demand to cut out-of-stocks

About 9% of Mangrove app orders lose an item because it is out of stock, and today's ordering rule (cover the next 4 days at the last 4 weeks' average) under-orders badly in festival weeks. Build a demand forecast for 50 fast-moving products in 20 stores and show how much it would reduce out-of-stocks compared with today's rule. Use a public grocery or retail sales dataset (for example the M5 competition data) or a synthetic Mangrove dataset you generate, and say which. Frame the problem, build leakage-free features, validate by time, compare at least two models with the baseline, look at error by product group, store band and festival week, turn the forecast into order quantities at a chosen percentile, and write a one-page summary the supply chain team could act on.

You will hand in

  • A notebook with data preparation, a time-based backtest, a baseline and at least two models, with error tables
  • An error analysis by product group, store size and festival week, with WAPE and bias
  • An ordering simulation that compares out-of-stocks and stock held under today's rule and under your forecast
  • A one-page summary for the supply chain team: the result, the limits, and a pilot proposal
Open the project brief

Check what you know

Already know some of this? Answer 6 quick questions, one from each lesson, and we will mark the lessons you can skim. It takes about 3 minutes and nothing is graded.

Questions

Do I need to know Python already?

Basic Python and pandas help, because each lesson shows the notebook code you would write. The auto-checked exercises are in SQL and JavaScript and run in your browser, so you can practise the ideas even before you set up Python.

Do I need a GPU or paid tools?

No. Everything runs in a free notebook on a laptop with pandas and scikit-learn. For the capstone you can use a public dataset such as the M5 competition data or generate a small synthetic one.

How much maths is there?

Only what you need to make good decisions: error measures, how trees and boosting learn, precision and recall, and thresholds from costs. Everything is explained with Mangrove numbers rather than formulas for their own sake. Statistics for Data Work covers uncertainty in more depth.

Does it cover deep learning and LLMs?

It shows where they fit and when to choose them instead of a tabular model or a plain rule. Building LLM features is covered in LLM Apps: Prompts, RAG and Evals, and running models every night is covered in Machine Learning in Production.

Is it really free?

Yes. Every lesson, podcast episode, exercise, quiz, final exam and certificate is free. The labs and their templates for real work are free too. Plus and Premium add every lab challenge, weekly extras and a mentor on top, and they never lock the tools or the courses.

How long does it take?

Each lesson shows an honest time for reading and doing. Most people finish a course in two to four weeks at three or four hours a week.

How does the final exam work?

You get 15 questions drawn at random from a larger bank. You need 70% to pass. If you do not pass, you can try again after 24 hours. The exam is graded on the server and you never see the answer key.