← Back to portfolio
Case Study · 07 / 17
Predictive Analytics · 2025

A model you can
actually explain.

A full predictive-analytics workflow — data prep, exploration, model comparison, probability calibration, and a decision-tree visualisation built to be read by a stakeholder, not a data scientist. The theme throughout: an honest probability beats a confident guess.

Role
Solo — modelling & write-up
Module
BUSI4371 · Foundational Business Analytics
Stack
scikit-learn · Pandas · Joblib
Status
Completed coursework
Fig. 07 · train → calibrate → explain
07
A risk score is only worth acting on if its 70% really means seventy.
§ 01 — The problem

Accuracy alone can't carry a decision.

A business risk model that outputs "high risk" with no calibrated probability and no reasoning is a black box a manager can't defend. In a business-analytics setting the model's legibility — can you trust its confidence, can you explain its call — matters as much as its raw accuracy.

So this was built as a complete pipeline whose deliverable isn't just a score: it's a calibrated probability and a decision-tree diagram that shows the path to each prediction.

An uncalibrated classifier is confident in exactly the wrong way.

§ 02 — Constraints

What the workflow had to deliver.

§ 03 — Architecture

Six stages, saved as artefacts.

The notebook moves from data to a shipped model: load and clean, explore, engineer features, train and compare, calibrate the winner, and export the whole pipeline.

01 — Prepare
Clean + EDA
Handle missing values, format variables, understand feature meaning.
02 — Engineer
Features
Select predictors, encode and transform, assemble the modelling pipeline.
03 — Compare
Model bake-off
Train several models, evaluate with a metrics summary, select the best.
04 — Ship
Calibrate + export
Calibrate probabilities, save the pipeline, render the decision tree.

Saving the whole pipeline — not just the estimator — means the preprocessing can never drift out of sync with the model at inference time. It is the difference between a model that works in the notebook and one that works when someone loads the .pkl months later.

§ 04 — What earned its keep

Calibration changed the usable output.

The model comparison picked a strong classifier on the metrics summary, but the step that made the output usable was calibration. Raw classifier scores clustered in ways that misrepresented real risk; after calibration, a 0.7 could be read as roughly a 70% chance — which is the only form a probability can safely inform a business action.

The decision-tree visualisation then did the explaining, turning the final model from a verdict into a traceable argument.

6
Workflow stages from raw data to shipped model
1
Calibrated pipeline exported end-to-end
100%
Preprocessing bundled with the model artefact
§ 05 — Explaining the model

A diagram beats a coefficient table.

The decision-tree render was chosen deliberately as the explanation artefact: a stakeholder can trace a single prediction down the branches and see exactly which thresholds drove it. That legibility is why a slightly simpler, explainable model can be the right business choice over a marginally more accurate opaque one.

§ 06 — What I'd do differently

Three things, next time.