# ronaldkanyepi/customer-churn-analysis architecture

> Architecture diagram of the GitHub repository ronaldkanyepi/customer-churn-analysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ronaldkanyepi/customer-churn-analysis
- Repository: https://github.com/ronaldkanyepi/customer-churn-analysis

## Overview

##### Project type and purpose
- This is a data-science/ML pipeline project implemented as a Jupyter Notebook, aimed at analyzing telecom customer data to predict churn. There is no traditional frontend/backend or web service—rather, the "system" is an automated analysis workflow that takes raw data, processes it, trains multiple models, evaluates them, and produces insights (visualizations, feature-importance, selected model).

##### File structure
- Top-level files:
- `Customer Churn Analysis.ipynb`: the primary driver of the pipeline (data loading → EDA → modeling → evaluation → interpretation).
- `requirements.txt`: pins Python dependencies (Pandas, NumPy, scikit-learn, XGBoost, SHAP, LIME, Optuna, TensorFlow/Keras, etc.).
- `images/`: stores output plots used in the notebook.
- `README.md`: describes the workflow step by step.
- No submodules or microservices—everything lives in one notebook.

##### README for additional insights
- The methodology section outlines a clear sequential pipeline with seven stages:
1. Data Loading & Initial Exploration
2. Data Cleaning & Preprocessing
3. Exploratory Data Analysis (EDA)
4. Feature Engineering
5. Model Building (multiple algorithms + hyperparameter tuning)
6. Model Evaluation (AUC-ROC)
7. Feature Importance (SHAP, LIME)
- Data Source: external CSV on S3.
- Outputs: various diagnostic plots and model artifacts.

## Diagram (Mermaid)

```mermaid
flowchart TD
    S3[(CSV on S3)]:::data
    subgraph "Data Preparation"
        Ingest["Data Ingestion & Preprocessing\n(Pandas)"]:::compute
        EDA["Exploratory Data Analysis\n(Seaborn/Matplotlib)"]:::compute
        FeatureEng["Feature Engineering\n(Pandas/NumPy)"]:::compute
    end
    subgraph "Modeling"
        Training["Model Training\n(Sklearn, XGBoost, Keras)"]:::compute
        Tuning["Hyperparameter Tuning\n(Optuna)"]:::compute
        Evaluation["Model Evaluation\n(AUC-ROC)"]:::compute
    end
    Interpretation["Model Interpretation\n(SHAP, LIME)"]:::compute
    Notebook["Notebook Orchestrator"]:::compute
    Requirements["requirements.txt"]:::doc
    README["README.md"]:::doc
    Images["Visualizations & Artifacts"]:::output
    ModelFiles["Trained Model Artifacts"]:::output

    Notebook --> Ingest
    S3 --> Ingest
    Ingest --> EDA
    EDA --> FeatureEng
    FeatureEng --> Training
    Training --> Tuning
    Tuning --> Evaluation
    Evaluation --> Interpretation
    Training --> ModelFiles
    Evaluation --> Images
    Interpretation --> Images

    click Ingest "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click EDA "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click FeatureEng "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Training "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Tuning "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Evaluation "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Interpretation "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Notebook "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/Customer Churn Analysis.ipynb"
    click Requirements "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/requirements.txt"
    click README "https://github.com/ronaldkanyepi/customer-churn-analysis/blob/main/README.md"
    click Images "https://github.com/ronaldkanyepi/customer-churn-analysis/tree/main/images/"

    classDef data fill:#a2d2ff,stroke:#0366d6,color:#000
    classDef compute fill:#cdeac0,stroke:#2a9d8f,color:#000
    classDef output fill:#ffddd2,stroke:#e63946,color:#000
    classDef doc fill:#f3eac2,stroke:#b08500,color:#000
```
