# akashavcoewala/churn-prediction-using-nlp-ml architecture

> Architecture diagram of the GitHub repository akashavcoewala/churn-prediction-using-nlp-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashavcoewala/churn-prediction-using-nlp-ml
- Repository: https://github.com/akashavcoewala/churn-prediction-using-nlp-ml

## Overview

This repository is a telecom churn-prediction project: a Flask web app accepts customer details and returns a churn result, while standalone scripts train and evaluate models from the dataset. The app also generates a PDF report. The README documents the saved XGBoost model and web prediction capability. Some app code is omitted, so model-loading and template-routing details are represented only where documented; the report-generation call is visible in the excerpt.

Main entry points: [`app.py`](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py) (Flask routes), [`churn2.csv`](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/churn2.csv) (Churn dataset), [`XGB.py`](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/XGB.py) (XGBoost training), [`xgboost_model.joblib`](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/xgboost_model.joblib) (Saved XGBoost model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Prediction web app"]
  node_flask["Flask routes<br/>[app.py]"]
  node_account["Login and registration<br/>[app.py]"]
  node_customer_form["Customer form<br/>[app.py]"]
  node_feature_prep["Feature preparation<br/>[app.py]"]
  node_prediction["Churn prediction<br/>[app.py]"]
  node_result_view["Prediction result<br/>[app.py]"]
  node_pdf_report["PDF report generation<br/>[app.py]"]
end

subgraph group_ml["Model development"]
  node_xgb_train["XGBoost training<br/>[XGB.py]"]
  node_xgb_eval["XGBoost evaluation<br/>[XGB2.py]"]
  node_rf_train["Random Forest baseline<br/>[RandomForest.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_dataset[("Churn dataset<br/>[churn2.csv]")]
  node_xgb_model["Saved XGBoost model"]
  node_churn_report["Churn report PDF<br/>[Churn_report.pdf]"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_flask
node_flask -->|"routes to"| node_account
node_flask -->|"routes to"| node_customer_form
node_customer_form -->|"provides fields"| node_feature_prep
node_feature_prep -->|"prepares features"| node_prediction
node_prediction -->|"uses model"| node_xgb_model
node_flask -->|"renders result"| node_result_view
node_flask -->|"generates report"| node_pdf_report
node_pdf_report -->|"writes PDF"| node_churn_report
node_dataset -->|"training input"| node_xgb_train
node_dataset -->|"training input"| node_xgb_eval
node_dataset -->|"training input"| node_rf_train
node_xgb_train -.->|"produces model"| node_xgb_model

click node_flask "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_account "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_customer_form "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_feature_prep "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_prediction "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_result_view "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_pdf_report "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py"
click node_xgb_train "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/XGB.py"
click node_xgb_eval "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/XGB2.py"
click node_rf_train "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/RandomForest.py"
click node_dataset "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/churn2.csv"
click node_xgb_model "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/xgboost_model.joblib"
click node_churn_report "https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/Churn_report.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_flask,node_account,node_customer_form,node_feature_prep,node_prediction,node_result_view,node_pdf_report toneBlue
class node_xgb_train,node_xgb_eval,node_rf_train toneAmber
class node_dataset,node_xgb_model,node_churn_report toneMint
class node_customer toneIndigo
```

## Components

### Prediction web app

- [Flask routes](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [Login and registration](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [Customer form](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [Feature preparation](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [Churn prediction](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [Prediction result](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`
- [PDF report generation](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/app.py): `app.py`

### Model development

- [XGBoost training](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/XGB.py): `XGB.py`
- [XGBoost evaluation](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/XGB2.py): `XGB2.py`
- [Random Forest baseline](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/RandomForest.py): `RandomForest.py`

### Data and artifacts

- [Churn dataset](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/churn2.csv): `churn2.csv`
- [Saved XGBoost model](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/xgboost_model.joblib): `xgboost_model.joblib`
- [Churn report PDF](https://github.com/akashavcoewala/churn-prediction-using-nlp-ml/blob/main/Churn_report.pdf): `Churn_report.pdf`

### Other components

- **Customer**

## Connections

- Customer → Flask routes: uses (evidence: `README.md`)
- Flask routes → Login and registration: routes to (evidence: `app.py`)
- Flask routes → Customer form: routes to (evidence: `app.py`)
- Customer form → Feature preparation: provides fields (evidence: `app.py`)
- Feature preparation → Churn prediction: prepares features (evidence: `app.py`)
- Churn prediction → Saved XGBoost model: uses model (evidence: `README.md`)
- Flask routes → Prediction result: renders result (evidence: `app.py`)
- Flask routes → PDF report generation: generates report (evidence: `app.py`)
- PDF report generation → Churn report PDF: writes PDF (evidence: `app.py`)
- Churn dataset → XGBoost training: training input (evidence: `XGB.py`)
- Churn dataset → XGBoost evaluation: training input (evidence: `XGB2.py`)
- Churn dataset → Random Forest baseline: training input (evidence: `RandomForest.py`)
- XGBoost training → Saved XGBoost model: produces model
