# bajaj-parag/telecom-company-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/bajaj-parag/telecom-company-churn-prediction
- Repository: https://github.com/bajaj-parag/telecom-company-churn-prediction

## Overview

##### Project Type and Purpose
- This is a machine-learning classification pipeline with a lightweight serving layer.
- Purpose: ingest customer call data, explore and preprocess it, train a churn-prediction model, then serve predictions through a simple API.

##### File Structure
- Churn.csv – raw input data store
- Final Model.ipynb – model-training notebook
- Project_EDA.html – exploratory analysis output
- app.py – inference/service layer (likely a Flask or FastAPI app)
- README.md – project description

##### README Insights
- Binary classification on telecom customer data
- Key features: usage minutes, plan flags, charges
- Outcome: churn = yes/no

##### Main Components & Their Relationships
a. Data Ingestion & Storage
- Component: “Raw Data Store” (Churn.csv)
b. Data Exploration & Preprocessing
- Component: “EDA & Preprocessing” (Final Model.ipynb + Project_EDA.html)
c. Model Training
- Component: “Model Trainer” (inside Jupyter notebook)
- Output: serialized model artifact (e.g., .pkl or .joblib)
d. Model Artifact Repository
- Component: “Model Store” (could be local file system)
e. Serving Layer / API
- Component: “Inference Service” (app.py)
- Exposes REST or CLI endpoint
f. Client / User Interface
- Component: “Client” (could be cURL, web front-end, or other services)

Raw Data → EDA/Preprocessing → Model Trainer → Model Artifact
Client → Inference Service → (loads Model Artifact, fetches or expects new input data) → returns Prediction

##### Architectural Patterns & Principles
- Linear ML pipeline (ETL → training → serving)
- Separation of concerns: notebooks for experimentation vs. Python script for serving
- Persistence of model artifact for reproducible inference
- Stateless API layer for scalability

##### Technologies, Frameworks & Libraries
- Python & Jupyter (Final Model.ipynb)
- Pandas / NumPy for data manipulation
- scikit-learn for modeling
- Flask or FastAPI (presumed in app.py)
- HTML report (Project_EDA.html) for EDA outputs

- Component labels + brief notes on their function
- Clear separation between “Training Pipeline” and “Inference/Serving Layer”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Training Pipeline
    subgraph "Training Pipeline"
        direction TB
        RawData(("Churn.csv")):::data
        Notebook["Final Model.ipynb\n(EDA & Training)"]:::processing
        Report["Project_EDA.html\n(EDA Report)"]:::processing
        ModelStore(("Trained Model\n(.pkl)")):::data

        RawData -->|"CSV"| Notebook
        Notebook -->|"JSON/CSV"| Report
        Notebook -->|".pkl"| ModelStore
    end

    %% Inference/Serving Layer
    subgraph "Inference/Serving Layer"
        direction TB
        Client["Client"]:::client
        Inference["Inference Service\n(app.py)"]:::service

        Client -->|"JSON Request"| Inference
        Inference -->|".pkl"| ModelStore
        Inference -->|"JSON Response"| Client
    end

    %% Documentation
    Doc["Project Documentation\n(README.md)"]:::doc

    %% Click Events
    click RawData "https://github.com/bajaj-parag/telecom-company-churn-prediction/blob/main/Churn.csv"
    click Notebook "https://github.com/bajaj-parag/telecom-company-churn-prediction/blob/main/Final Model.ipynb"
    click Report "https://github.com/bajaj-parag/telecom-company-churn-prediction/blob/main/Project_EDA.html"
    click Inference "https://github.com/bajaj-parag/telecom-company-churn-prediction/blob/main/app.py"
    click Doc "https://github.com/bajaj-parag/telecom-company-churn-prediction/blob/main/README.md"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef processing fill:#90EE90,stroke:#000,stroke-width:1px
    classDef service fill:#FFA500,stroke:#000,stroke-width:1px
    classDef client fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef doc fill:#FFFFE0,stroke:#000,stroke-width:1px
```
