# youssefelhassini063-spec/powerco-churn-prediction architecture

> Architecture diagram of the GitHub repository youssefelhassini063-spec/powerco-churn-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youssefelhassini063-spec/powerco-churn-prediction
- Repository: https://github.com/youssefelhassini063-spec/powerco-churn-prediction

## Overview

This repository is a notebook-based churn-prediction workflow for PowerCo SMEs: exploratory analysis informs feature engineering, followed by model evaluation and business diagnostics. The README documents a cost-sensitive XGBoost approach, a 20% decision threshold, SHAP analysis, and an executive slide deck. Raw data is not included. Notebook internals were not sampled, so the graph follows documented stages and avoids assumptions about specific code-level calls.

Main entry points: [`03_Model_Evaluation.ipynb`](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb) (Model evaluation), [`01_EDA.ipynb`](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/01_EDA.ipynb) (Exploratory analysis), [`Predictive_Churn_Engine_for_PowerCo_SMEs.pdf`](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/Predictive_Churn_Engine_for_PowerCo_SMEs.pdf) (Executive findings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Data analysis"]
  node_eda["Exploratory analysis<br/>[01_EDA.ipynb]"]
  node_features["Feature engineering"]
end

subgraph group_modeling["Churn modeling"]
  node_evaluation["Model evaluation"]
  node_random_forest["Random Forest baseline"]
  node_xgboost["Penalized XGBoost"]
  node_threshold["Threshold calibration"]
end

subgraph group_impact["Business impact"]
  node_shap["SHAP diagnostics"]
  node_deck["Executive findings"]
end

node_datasets[("BCG X datasets")]

node_datasets -->|"provides data"| node_eda
node_eda -->|"informs features"| node_features
node_features -->|"provides features"| node_evaluation
node_evaluation -->|"tests baseline"| node_random_forest
node_evaluation -->|"tests model"| node_xgboost
node_evaluation -->|"calibrates threshold"| node_threshold
node_evaluation -->|"extracts values"| node_shap
node_shap -->|"informs findings"| node_deck

click node_eda "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/01_EDA.ipynb"
click node_evaluation "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb"
click node_random_forest "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb"
click node_xgboost "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb"
click node_threshold "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb"
click node_shap "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb"
click node_deck "https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/Predictive_Churn_Engine_for_PowerCo_SMEs.pdf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_eda,node_features toneBlue
class node_evaluation,node_random_forest,node_xgboost,node_threshold,node_datasets toneAmber
class node_shap,node_deck toneMint
```

## Components

### Data analysis

- [Exploratory analysis](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/01_EDA.ipynb): `01_EDA.ipynb`
- **Feature engineering**

### Churn modeling

- [Model evaluation](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb): `03_Model_Evaluation.ipynb`
- [Random Forest baseline](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb): `03_Model_Evaluation.ipynb`
- [Penalized XGBoost](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb): `03_Model_Evaluation.ipynb`
- [Threshold calibration](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb): `03_Model_Evaluation.ipynb`

### Business impact

- [SHAP diagnostics](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/03_Model_Evaluation.ipynb): `03_Model_Evaluation.ipynb`
- [Executive findings](https://github.com/youssefelhassini063-spec/powerco-churn-prediction/blob/main/Predictive_Churn_Engine_for_PowerCo_SMEs.pdf): `Predictive_Churn_Engine_for_PowerCo_SMEs.pdf`

### Other components

- **BCG X datasets**

## Connections

- BCG X datasets → Exploratory analysis: provides data
- Exploratory analysis → Feature engineering: informs features
- Feature engineering → Model evaluation: provides features
- Model evaluation → Random Forest baseline: tests baseline
- Model evaluation → Penalized XGBoost: tests model
- Model evaluation → Threshold calibration: calibrates threshold
- Model evaluation → SHAP diagnostics: extracts values
- SHAP diagnostics → Executive findings: informs findings
