# pradnya1208/telecom-customer-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/pradnya1208/telecom-customer-churn-prediction
- Repository: https://github.com/pradnya1208/telecom-customer-churn-prediction

## Overview

##### Project type and purpose
- This is a data‐science/ML project implemented as a Jupyter notebook (“Customer churn prediction.ipynb”) under the Scripts folder.
- Its purpose is to ingest a telecom‐churn dataset, perform exploratory data analysis (EDA), train multiple classification models, evaluate them (with k-fold CV and confusion matrices), and produce visual output in the output/ directory.

##### File structure
- Top level:
- README.md – project overview, objectives, results.
- Scripts/ – the core code and raw data:
– Customer churn prediction.ipynb – the main notebook orchestrating ingestion → EDA → modeling → evaluation.
– data.csv – the raw telecom‐churn dataset.
- output/ – generated charts, images, confusion matrices, model‐comparison plots.
- No traditional “backend” or “frontend,” but a linear data‐processing pipeline in notebook form.

##### README for additional insights
- It describes:
- Dataset attributes (customer demographics, services, tenure, charges).
- EDA steps and key findings (distribution plots).
- ML models used (Logistic Regression, KNN, Naive Bayes, Decision Tree, Random Forest, AdaBoost, Gradient Boosting, Voting Classifier).
- Final model selection and confusion matrix stats.

a. Main components
1. Data Source
– Kaggle Telco Customer Churn CSV (data.csv under Scripts/)
2. Data Processing & Feature Engineering
– pandas data‐ cleaning, handling missing values, encoding categorical features.
3. Exploratory Data Analysis (EDA)
– seaborn/matplotlib steps that produce distribution plots, correlation heatmaps, service‐level comparisons.
4. Model Training Pipeline
– individual model trainers (LR, KNN, NB, DT, RF, AdaBoost, GradBoost)
– k-fold cross validation loop
– hyperparameter tuning placeholder
5. Ensemble / Voting Classifier
– combines gradient boosting, logistic regression, AdaBoost
6. Model Evaluation & Output
– accuracy scores, confusion matrices, saved plots → output/
7. Environment & Tools
– Jupyter Notebook, Python interpreter, scikit-learn, pandas, seaborn, NumPy

b. Relationships & Data Flow
– From processed features → each Model Training component (parallel branches)
– From each model’s CV results → Model Comparison block
– From top three models → Voting Classifier block → Final predictions
– From Final predictions → Evaluation block → Outputs

c. Architectural patterns & design principles
– Batch‐processing pipeline (one‐shot notebook run)
– Modular training steps per algorithm (separate stages)
– Ensemble pattern for final classifier
– Clear separation between data ingestion, analysis, training, and evaluation

d. Key technologies & libraries
– Python (3.x), Jupyter Notebook
– pandas, NumPy (data wrangling)
– seaborn, matplotlib (visualization)
– scikit-learn (modeling: classifiers, cross‐validation, ensemble)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Documentation Layer"
        README["Project Overview & Documentation"]:::doc
        icons["Decorative Assets"]:::doc
    end

    subgraph "Orchestration Layer"
        Notebook["Jupyter Notebook\n(Customer churn prediction.ipynb)"]:::process
    end

    subgraph "ML Pipeline"
        DataSource["Data Source\n(data.csv)"]:::datastore
        Preprocessing["Data Processing & Feature Engineering"]:::process
        EDA["Exploratory Data Analysis"]:::process
        subgraph "Model Training"
            LR["Logistic Regression"]:::model
            KNN["KNN"]:::model
            NB["Naive Bayes"]:::model
            DT["Decision Tree"]:::model
            RF["Random Forest"]:::model
            AB["AdaBoost"]:::model
            GB["Gradient Boosting"]:::model
        end
        Ensemble["Voting Ensemble"]:::model
        Evaluation["Model Evaluation & Output"]:::output
        OutputDir["Output Storage\n(output/)"]:::output
    end

    %% Data flow
    Notebook --> DataSource
    DataSource --> Preprocessing
    Preprocessing --> EDA
    EDA --> LR
    EDA --> KNN
    EDA --> NB
    EDA --> DT
    EDA --> RF
    EDA --> AB
    EDA --> GB
    LR --> Ensemble
    KNN --> Ensemble
    NB --> Ensemble
    DT --> Ensemble
    RF --> Ensemble
    AB --> Ensemble
    GB --> Ensemble
    Ensemble --> Evaluation
    Evaluation --> OutputDir

    %% Click Events
    click Notebook "https://github.com/pradnya1208/telecom-customer-churn-prediction/blob/main/Scripts/Customer churn prediction.ipynb"
    click DataSource "https://github.com/pradnya1208/telecom-customer-churn-prediction/blob/main/Scripts/data.csv"
    click EDA "https://github.com/pradnya1208/telecom-customer-churn-prediction/tree/main/output/"
    click Evaluation "https://github.com/pradnya1208/telecom-customer-churn-prediction/tree/main/output/"
    click OutputDir "https://github.com/pradnya1208/telecom-customer-churn-prediction/tree/main/output/"
    click README "https://github.com/pradnya1208/telecom-customer-churn-prediction/blob/main/README.md"
    click icons "https://github.com/pradnya1208/telecom-customer-churn-prediction/tree/main/icons/"

    %% Styles
    classDef datastore fill:#E3F2FD,stroke:#90CAF9,color:#0D47A1;
    classDef process fill:#E8F5E9,stroke:#66BB6A,color:#1B5E20;
    classDef model fill:#FFF3E0,stroke:#FFA726,color:#E65100;
    classDef output fill:#F3E5F5,stroke:#CE93D8,color:#4A148C;
    classDef doc fill:#ECEFF1,stroke:#B0BEC5,color:#37474F;
```
