Project

Will this client miss next month's payment?

You build a model for 30,000 credit card clients that says which of them will miss next month's payment, from the CSV to a model that beats two baselines on five folds, a line set by what each mistake costs, a test pile opened once, and the model saved with its card. Then the same build runs on a table of your own.

About 4 hours. You need your own computer, with uv; about 200 MB of disk for the packages and 3 MB for the data.

You build it in the starter, one step at a time. The finished project is there to read when you are stuck.

Terminal
git clone https://github.com/FaydenAI/learn-machine-learning.git
cd learn-machine-learning/project/starter
uv sync

Get the starterRead the finished project

  1. Part 1

    The clients, a closed test pile, and two baselines

    A bank in Taiwan wants to call the clients who are about to miss a payment, before they miss it. You have 30,000 of its clients from 2005: each one's credit limit, age and education, and six months of bills, payments and late payments. This part gets the table, splits it once, and scores the two answers every model has to beat.

    UsesWhat machine learning isTraining, validation and test dataPrecision, recall and the confusion matrixTime series and forecasting

    1. Get the clients, and run the testsRun it
    2. Split once, before anything elseYour turn
    3. The inputs and the labelYour turn
    4. A rule by hand, as a modelYour turn
    5. The two baselinesRun it

    When you have run it

    The two baselines are right equally often. What share of the clients who missed October's payment does the rule by hand find?

    %

  2. Part 2

    A pipeline, a race on folds, and the line

    Now the models. Three of the course's models race on the same five folds of the training pile, each behind the same preparation, with the two baselines beside them. The race picks one, and the line comes from what each mistake costs. `train.py` saves the pick with its line, for part 3.

    UsesPreparing featuresLogistic regressionOverfitting and regularizationRandom forestsGradient boostingCross-validation and tuningThresholds, ROC and PR curvesData leakage

    1. One preparation for every modelYour turn
    2. The raceYour turn
    3. A tie is not a winYour turn
    4. The cheapest lineYour turn
    5. Train itRun it

    When you have run it

    What is your cheapest line?

  3. Part 3

    The test pile, opened once, and the model's card

    The choice is made. `evaluate.py` loads the saved model, as next month's job would, opens the test pile once and writes the model's card: how good it is against the baselines, how it does for each group, what it leans on, and why it picked one client.

    UsesPrecision, recall and the confusion matrixThresholds, ROC and PR curvesBias and fairnessFeature importance and SHAPTraining, validation and test data

    1. A score on rows it never sawYour turn
    2. Each group on its ownYour turn
    3. What it leans onYour turn
    4. Why this clientYour turn
    5. Open the test pileRun it

    When you have run it

    On the test pile, what does the model's line cost a client?

  4. Part 4

    A table of your own

    This part is yours. Find a table with a column that says yes or no, look at it before anything learns from it, describe it in `config.py`, and run the whole build on it. Only `look.py` has a frame to fill in. `solution/` does it once, on 1,000 credits of a bank in southern Germany from the 1970s.

    UsesCleaning a tableWhat machine learning isData leakageThresholds, ROC and PR curvesCross-validation and tuning

    1. Look before you trainOn your own
    2. Your tableOn your own
    3. Your rule and your costsOn your own
    4. The build on your tableRun it

    When you have run it

    solution/ runs the same build on the 1,000 South German credits, and its card is solution/reports/mine-card.md. Which model does its race pick?

Run on Python 3.12, scikit-learn 1.9.1, pandas 3.1.2, fairlearn 0.15.0, shap 0.54.1. Checked on .