learntodriveai.dev/Machine Learning/Churn Prediction: Classical ML Full Loop
Machine LearningProject 015 unitsVerified on 16 October 2026

Churn Prediction: Classical ML Full Loop

Emeka OkaforHead of Customer Retention · Mobile network operator · Lagos, Nigeria
Email · from Emeka
My retention team does outreach — calls, special offers, plan upgrades — but right now we're basically guessing who to call. We wait until someone's usage drops to zero and by then they've already ported to MTN or Airtel.
Chat with Emeka

What you hand back

  • A profile of the subscriber data
  • A preprocessed, stratified train and test split
  • A churn model checked on churn recall
  • Feature importances in business terms
  • A churn prediction API with request logging
  • A README and a delivery note

5 units

  1. Unit 1: The Brief and the Data

    Read Emeka's brief and tickets, set up the project, and profile the subscriber data against its dictionary.

    Open unit 1
  2. Unit 2: Preprocessing and Splitting

    Impute missing values, encode categories, scale numbers, and split the data with the churn proportion preserved.

    Open unit 2
  3. Unit 3: Training and Evaluation

    Train a RandomForest, check churn recall against the 0.55 target, and explain the results and drivers to Emeka.

    Open unit 3
  4. Unit 4: Serving the Model

    Save the model, serve it through a FastAPI endpoint, test bad input, and add prediction logging.

    Open unit 4
  5. Unit 5: Project Close

    Commit and push the project, write the README, and deliver the finished system to Emeka.

    Open unit 5
Read the full brief

You're building a churn prediction system for a mobile network operator in Lagos -- a model that predicts which subscribers will leave, served as an API the retention team can query weekly.

The discipline skills: data profiling, preprocessing with documented decisions, training a classifier on imbalanced data, evaluating with per-class metrics, and serving a model as a FastAPI endpoint.

The AI-direction lesson: this is your first time directing AI through a full ML workflow. AI will produce code that runs, models that train, and metrics that look good. The gap between "it runs" and "it's correct" is the entire project. AI defaults to accuracy on imbalanced data -- 92% accuracy, near-zero recall on the class that matters. It preprocesses without explaining assumptions. It generates endpoints that handle the happy path. Everything you need to catch these failures is provided: the brief, the dataset, the evaluation criteria. Your job is to check AI's output against those targets and notice when "looks right" and "passes verification" are different things.

Your Role

You're building Emeka's churn prediction system. You direct Claude Code through the entire workflow — from profiling the data to serving a live API endpoint. AI writes the code. You provide direction, verify the results, and communicate back to Emeka.

This is the first real project. Everything you need is provided: the brief, the dataset, the algorithm, the evaluation criteria, the ticket breakdown. Your job is not to decide what to build. Your job is to direct AI accurately and verify that what it produces actually works for Emeka's problem.

What's New

Setup gave you the tools. This is where you use them for real work.

What changes is the shape of the work itself. You'll move through a full ML workflow — data profiling, preprocessing, training, evaluation, serving — directing AI through each stage. Every stage produces something concrete you can check against specific criteria.

Tools

  • Python / pandas — data loading and profiling
  • scikit-learn — preprocessing, training, evaluation
  • Jupyter — notebook workflow
  • FastAPI / uvicorn — model serving
  • Claude Code — AI direction
  • Git / GitHub — version control
  • curl — API testing

Materials

Everything is provided for this project:

  • Emeka's email with the full brief
  • A clean subscriber dataset
  • A data dictionary describing every column
  • Algorithm and evaluation criteria (RandomForest, recall ≥ 0.55 on the churn class)
  • A complete ticket breakdown for every stage of the work

You won't need to decide what to build or how to structure the work. The materials handle that. Focus on directing AI through each ticket and verifying what it produces.

Materials · 5 files
Start Project 1

You work at a computer with a terminal. Signed in, your place is saved.