# chaitanya-g53/customer-churn-prediction-xgboost architecture

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

- Interactive diagram: https://gitdiagram.com/chaitanya-g53/customer-churn-prediction-xgboost
- Repository: https://github.com/chaitanya-g53/customer-churn-prediction-xgboost

## Overview

This repository trains a bank-customer churn classifier and serves interactive predictions through a Streamlit dashboard backed by a local Flask endpoint. The principal workflow is customer-profile entry → HTTP prediction request → feature encoding and XGBoost inference → risk assessment and dashboard display. The README documents the notebook’s exploration, preprocessing, training, evaluation, and feature-importance stages; those details are documented rather than verified from notebook source here.

Main entry points: [`app.py`](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py) (Prediction Endpoint), [`Customer-Churn-Prediction-XGBOOST.pkl`](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/Customer-Churn-Prediction-XGBOOST.pkl) (Trained Model), [`CustomerChrun_XGBoost.ipynb`](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/CustomerChrun_XGBoost.ipynb) (Model Workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_development["Model Development"]
  node_notebook["Model Workflow"]
  node_model["Trained Model"]
end

subgraph group_serving["Prediction Service"]
  node_flask_endpoint["Prediction Endpoint<br/>[app.py]"]
  node_feature_encoding["Feature Encoding<br/>[app.py]"]
  node_inference["Model Inference<br/>[app.py]"]
end

subgraph group_dashboard["Customer Dashboard"]
  node_streamlit_inputs["Profile Inputs<br/>[app.py]"]
  node_streamlit_client["Prediction Client<br/>[app.py]"]
  node_risk_assessment["Risk Assessment<br/>[app.py]"]
  node_dashboard_results["Dashboard Results<br/>[app.py]"]
end

node_customer(("Dashboard User"))

node_customer -->|"enters profile"| node_streamlit_inputs
node_notebook -->|"serializes model"| node_model
node_model -->|"loaded for inference"| node_inference
node_streamlit_inputs -->|"builds payload"| node_streamlit_client
node_streamlit_client -->|"POSTs prediction"| node_flask_endpoint
node_flask_endpoint -->|"encodes features"| node_feature_encoding
node_flask_endpoint -->|"calls model"| node_inference
node_inference -->|"returns prediction"| node_flask_endpoint
node_flask_endpoint -->|"returns JSON"| node_streamlit_client
node_streamlit_client -->|"derives risk"| node_risk_assessment
node_risk_assessment -->|"supplies display values"| node_dashboard_results
node_streamlit_inputs -->|"supplies profile"| node_dashboard_results
node_customer -->|"views results"| node_dashboard_results

click node_notebook "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/CustomerChrun_XGBoost.ipynb"
click node_model "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/Customer-Churn-Prediction-XGBOOST.pkl"
click node_streamlit_inputs "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_streamlit_client "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_flask_endpoint "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_feature_encoding "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_inference "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_risk_assessment "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"
click node_dashboard_results "https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py"

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_notebook,node_model,node_customer toneBlue
class node_flask_endpoint,node_feature_encoding,node_inference toneAmber
class node_streamlit_inputs,node_streamlit_client,node_risk_assessment,node_dashboard_results toneMint
```

## Components

### Model Development

- [Model Workflow](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/CustomerChrun_XGBoost.ipynb): `CustomerChrun_XGBoost.ipynb`
- [Trained Model](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/Customer-Churn-Prediction-XGBOOST.pkl): `Customer-Churn-Prediction-XGBOOST.pkl`

### Prediction Service

- [Prediction Endpoint](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`
- [Feature Encoding](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`
- [Model Inference](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`

### Customer Dashboard

- [Profile Inputs](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`
- [Prediction Client](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`
- [Risk Assessment](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`
- [Dashboard Results](https://github.com/chaitanya-g53/customer-churn-prediction-xgboost/blob/main/app.py): `app.py`

### Other components

- **Dashboard User**

## Connections

- Dashboard User → Profile Inputs: enters profile
- Model Workflow → Trained Model: serializes model
- Trained Model → Model Inference: loaded for inference
- Profile Inputs → Prediction Client: builds payload
- Prediction Client → Prediction Endpoint: POSTs prediction
- Prediction Endpoint → Feature Encoding: encodes features
- Prediction Endpoint → Model Inference: calls model
- Model Inference → Prediction Endpoint: returns prediction
- Prediction Endpoint → Prediction Client: returns JSON
- Prediction Client → Risk Assessment: derives risk
- Risk Assessment → Dashboard Results: supplies display values
- Profile Inputs → Dashboard Results: supplies profile
- Dashboard User → Dashboard Results: views results
