A clean-room Python project demonstrating a governed synthetic machine learning workflow for voluntary attrition prediction, intervention prioritisation, treatment logging, treatment-aware re-learning, and portfolio-ready reporting in a financial-services context.
This repository uses synthetic data only. It does not include, reproduce, reference, or depend on any real customer, member, employer, financial, operational, confidential, or proprietary organisation data.
The end-to-end learning-loop pipeline has been implemented and validated locally.
Current pipeline capabilities:
- Generates a synthetic financial-services customer-month panel.
- Engineers a reusable feature table.
- Runs a rules-based baseline.
- Trains a first machine learning model.
- Creates an intervention-prioritisation list.
- Simulates a synthetic treatment log.
- Trains a treatment-aware second machine learning model.
- Produces governance and model-comparison reports.
- Produces portfolio visual reporting outputs.
- Includes automated tests for the main project components.
The project compares three decision approaches:
- A rules-based baseline.
- A first supervised machine learning model.
- A treatment-aware machine learning model retrained using a synthetic intervention log.
The objective is not only to predict voluntary attrition risk, but to demonstrate how risk scoring can be connected to responsible intervention design, control groups, outcome logging, governance checks, and iterative model learning.
This project is designed as a portfolio-quality demonstration of applied analytics engineering and responsible machine learning for customer retention.
It shows the ability to move from a business problem to a reproducible technical workflow:
- Problem framing.
- Synthetic data generation.
- Feature engineering.
- Baseline modelling.
- Machine learning modelling.
- Intervention design.
- Treatment/control learning.
- Governance checks.
- Visual reporting.
- Testable Python package structure.
This project uses fully synthetic data generated by code in this repository.
No real customer, member, employer, financial, operational, or proprietary data is included.
The synthetic data is designed only to represent plausible behavioural patterns for demonstration purposes in a generic financial-services setting.
The default pipeline profile is configured as:
- Synthetic customers: 25,000.
- Monthly snapshots: 24.
- Target: voluntary attrition over a future 90-day window.
- Intervention capacity: 1,000 customers.
- Treatment share: 80%.
- Control share: 20%.
- Random seed: 42.
.
├── src/
│ ├── config.py
│ ├── synthetic_data.py
│ ├── feature_engineering.py
│ ├── rules_baseline.py
│ ├── model_training.py
│ ├── intervention_policy.py
│ ├── treatment_log.py
│ ├── model_v2_learning.py
│ ├── governance_reporting.py
│ ├── visual_reporting.py
│ └── run_pipeline.py
├── tests/
├── outputs/
│ └── plots/
├── docs/
├── notebooks/
├── dashboard/
├── CLEAN_ROOM_STATEMENT.md
├── DATA_PROVENANCE.md
├── DISCLAIMER.md
├── ETHICS_AND_GOVERNANCE.md
├── MODEL_CARD.md
├── README.md
├── requirements.txt
└── pytest.ini