Sentinel is a production-grade machine learning system designed to predict customer churn in real-time. It features an automated ETL pipeline, robust feature engineering, XGBoost training, and an interactive Streamlit dashboard for executive insights and individual customer risk scoring.
The system follows a modular architecture designed for scalability and maintainability.
graph TD
A["Raw Data - SQLite"] -->|Extraction| B["Polars ETL Pipeline"]
B -->|Cleaning & Engineering| C["Feature Store"]
C -->|Training| D["XGBoost Classifier"]
D -->|Experiment Tracking| E["MLflow"]
D -->|Artifacts| F["Model Registry"]
C -->|Inference| G["Streamlit Dashboard"]
F --> G
G -->|Interactive UI| H["End User"]
- Automated ETL: Consumes raw data from SQLite, handles missing values, and generates features like
tenureandtotal_charges. - Advanced Modeling: Utilizes XGBoost with
ColumnTransformerpipelines for handling categorical and numerical data. - Experiment Tracking: Integrated MLflow logging for metrics and hyperparameters.
- Interactive Dashboard:
- Executive Overview: High-level KPIs and churn distribution charts.
- Customer Inspector: Real-time "what-if" analysis and risk scoring.
- DevOps Ready: Dockerized application with CI/CD workflows and Makefile automation.
- Python 3.9+
- Docker (Optional)
-
Clone the Repository
git clone https://github.com/yourusername/sentinel-churn-engine.git cd sentinel-churn-engine -
Install Dependencies
make setup
-
Train the Model
make train
This generates the artifacts in
src/models/saved/. -
Launch the Dashboard
make app
Access the app at
http://localhost:8501.
To run the application in a container:
docker build -t sentinel-engine .
docker run -p 8501:8501 sentinel-engine| Metric | Score | Description |
|---|---|---|
| Accuracy | ~85% | Overall correct predictions |
| Recall | ~78% | Ability to capture actual churners |
| AUC-ROC | ~0.88 | Discriminative power of the model |
Note: Results may vary based on the specific random seed used during data generation.
Sentinel-Churn-Engine/
├── data/ # Raw and processed data
├── src/
│ ├── ingestion/ # Data loading and mocking
│ ├── processing/ # Cleaning and feature engineering
│ ├── models/ # Training scripts
│ └── dashboard/ # Streamlit app
├── tests/ # Unit tests
├── Makefile # Automation scripts
├── Dockerfile
├── README.md
└── .gitignore