← Field notes yingzhiva.github.io
Field Notes · A Collection

Modelling Who Refers

Notes from the referral analytics project: a customer referral programme at a digital wealth manager, and an XGBoost model built to be explained rather than to predict. The gap between certificate exercises and a real use case, one obstacle at a time.

  1. 01

    Leakage Hides in the Encoder

    Getting real data into the model without fooling yourself: class imbalance without reaching for resampling, Weight-of-Evidence encoding for high-cardinality categoricals, and the target leakage a pipeline exists to prevent.

  2. 02

    Stop Tuning, Start Reading

    Deciding the model is finished and reading what it says: how to judge an AUC, why the fold spread answers “keep tuning?” better than the mean, and how to interpret a SHAP summary plot.

They read in order: No. 01 builds a model you can trust, No. 02 decides it’s done and reads it, but each stands on its own. The code behind both is public: the Referral Analytics repo holds the full notebook, running on a synthetic dataset that reproduces the schema and distributions of the original data-warehouse exports. No real customer data.