# vemulasailahith/customer_churn_prediction_system architecture

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

- Interactive diagram: https://gitdiagram.com/vemulasailahith/customer_churn_prediction_system
- Repository: https://github.com/vemulasailahith/customer_churn_prediction_system

## Overview

This is a small Streamlit customer-churn application. A user enters customer profile, service, plan, financial, and value information, then requests a prediction. The app preprocesses the input, obtains churn classification and probability, and scales segmentation features before assigning a K-Means cluster and displaying the results. README capabilities and the sampled app support this flow; segmentation implementation details are partly omitted, so the graph shows only the documented scaler-to-cluster relationship.

Main entry points: [`app.py`](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py) (Streamlit App), [`customer_churn_artifacts.pkl`](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl) (Churn Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_app["Streamlit App<br/>[app.py]"]
  node_form["Customer Inputs<br/>[app.py]"]
  node_results["Prediction Results<br/>[app.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_preprocessor["Preprocessor"]
  node_logistic["Churn Model"]
  node_scaler["Feature Scaler"]
  node_kmeans["K-Means Model"]
  node_artifact_file["Trained Artifacts"]
end

node_customer(("Customer"))

node_customer -->|"enters details"| node_form
node_form -->|"submits inputs"| node_app
node_app -->|"loads"| node_artifact_file
node_app -->|"transforms inputs"| node_preprocessor
node_preprocessor -->|"returns features"| node_app
node_app -->|"predicts churn"| node_logistic
node_logistic -->|"returns prediction"| node_app
node_logistic -->|"returns probability"| node_app
node_app -->|"scales features"| node_scaler
node_app -->|"assigns cluster"| node_kmeans
node_app -->|"displays results"| node_results
node_results -->|"shows output"| node_customer

click node_app "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py"
click node_form "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py"
click node_preprocessor "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl"
click node_logistic "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl"
click node_scaler "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl"
click node_kmeans "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl"
click node_artifact_file "https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl"
click node_results "https://github.com/vemulasailahith/customer_churn_prediction_system/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_app,node_form,node_results toneBlue
class node_preprocessor,node_logistic,node_scaler,node_kmeans,node_artifact_file toneAmber
class node_customer toneIndigo
```

## Components

### Application

- [Streamlit App](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py): `app.py`
- [Customer Inputs](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py): `app.py`
- [Prediction Results](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/app.py): `app.py`

### Model Artifacts

- [Preprocessor](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl): `customer_churn_artifacts.pkl`
- [Churn Model](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl): `customer_churn_artifacts.pkl`
- [Feature Scaler](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl): `customer_churn_artifacts.pkl`
- [K-Means Model](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl): `customer_churn_artifacts.pkl`
- [Trained Artifacts](https://github.com/vemulasailahith/customer_churn_prediction_system/blob/main/customer_churn_artifacts.pkl): `customer_churn_artifacts.pkl`

### Other components

- **Customer**

## Connections

- Customer → Customer Inputs: enters details
- Customer Inputs → Streamlit App: submits inputs
- Streamlit App → Trained Artifacts: loads
- Streamlit App → Preprocessor: transforms inputs
- Preprocessor → Streamlit App: returns features
- Streamlit App → Churn Model: predicts churn
- Churn Model → Streamlit App: returns prediction
- Churn Model → Streamlit App: returns probability
- Streamlit App → Feature Scaler: scales features
- Streamlit App → K-Means Model: assigns cluster
- Streamlit App → Prediction Results: displays results
- Prediction Results → Customer: shows output
