# anjali22-lgtm/telecom-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/anjali22-lgtm/telecom-churn-prediction
- Repository: https://github.com/anjali22-lgtm/telecom-churn-prediction

## Overview

This is a Streamlit dashboard for predicting telecom customer churn from manually entered customer attributes. Its central workflow collects inputs, preprocesses them, scores them with a saved model, classifies risk, and presents prediction results, customer summary, and visualizations. The README also describes the broader data-to-model training workflow, but the repository tree exposes no source modules for those stages. Relationships below are limited to the sampled app excerpt and documented capabilities; no training pipeline or persistent data store is shown.

Main entry points: [`app.py`](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py) (Streamlit app), [`features.pkl`](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/features.pkl) (Feature schema), [`scaler.pkl`](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/scaler.pkl) (Feature scaler), [`churn_model.pkl`](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/churn_model.pkl) (Churn model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit app<br/>[app.py]"]
  node_form["Customer inputs<br/>[app.py]"]
  node_animation["Lottie animation<br/>[app.py]"]
end

subgraph group_prediction["Prediction"]
  node_preprocess["Input preprocessing<br/>[app.py]"]
  node_features["Feature schema<br/>[features.pkl]"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_model["Churn model<br/>[churn_model.pkl]"]
end

subgraph group_results["Results"]
  node_risk["Risk classification<br/>[app.py]"]
  node_summary["Customer summary<br/>[app.py]"]
  node_gauge["Probability gauge<br/>[app.py]"]
  node_pie["Probability pie chart<br/>[app.py]"]
  node_metrics["Model metrics<br/>[app.py]"]
  node_dashboard_result["Prediction dashboard<br/>[app.py]"]
end

node_customer(("Customer"))
node_lottie_service["Animation service"]

node_customer -->|"enters attributes"| node_form
node_app -->|"renders"| node_animation
node_animation -->|"fetches animation"| node_lottie_service
node_form -->|"prepares input"| node_preprocess
node_preprocess -->|"orders columns"| node_features
node_preprocess -->|"scales values"| node_scaler
node_app -->|"loads model"| node_model
node_app -->|"preprocesses input"| node_preprocess
node_app -->|"classifies probability"| node_risk
node_app -->|"renders results"| node_dashboard_result
node_dashboard_result -->|"shows summary"| node_summary
node_dashboard_result -->|"shows probability"| node_gauge
node_dashboard_result -->|"shows distribution"| node_pie
node_dashboard_result -->|"shows metrics"| node_metrics

click node_app "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_form "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_animation "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_preprocess "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_features "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/features.pkl"
click node_scaler "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/scaler.pkl"
click node_model "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/churn_model.pkl"
click node_risk "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_summary "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_gauge "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_pie "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_metrics "https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py"
click node_dashboard_result "https://github.com/anjali22-lgtm/telecom-churn-prediction/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_animation toneBlue
class node_preprocess,node_features,node_scaler,node_model toneAmber
class node_risk,node_summary,node_gauge,node_pie,node_metrics,node_dashboard_result toneMint
class node_customer,node_lottie_service toneIndigo
```

## Components

### Dashboard

- [Streamlit app](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Customer inputs](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Lottie animation](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`

### Prediction

- [Input preprocessing](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Feature schema](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/features.pkl): `features.pkl`
- [Feature scaler](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/scaler.pkl): `scaler.pkl`
- [Churn model](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/churn_model.pkl): `churn_model.pkl`

### Results

- [Risk classification](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Customer summary](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Probability gauge](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Probability pie chart](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Model metrics](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`
- [Prediction dashboard](https://github.com/anjali22-lgtm/telecom-churn-prediction/blob/main/app.py): `app.py`

### Other components

- **Customer**
- **Animation service**

## Connections

- Customer → Customer inputs: enters attributes (evidence: `app.py`)
- Streamlit app → Lottie animation: renders (evidence: `app.py`)
- Lottie animation → Animation service: fetches animation (evidence: `app.py`)
- Customer inputs → Input preprocessing: prepares input (evidence: `app.py`)
- Input preprocessing → Feature schema: orders columns (evidence: `app.py`)
- Input preprocessing → Feature scaler: scales values (evidence: `app.py`)
- Streamlit app → Churn model: loads model (evidence: `app.py`)
- Streamlit app → Input preprocessing: preprocesses input (evidence: `app.py`)
- Streamlit app → Risk classification: classifies probability (evidence: `app.py`)
- Streamlit app → Prediction dashboard: renders results (evidence: `app.py`)
- Prediction dashboard → Customer summary: shows summary (evidence: `app.py`)
- Prediction dashboard → Probability gauge: shows probability (evidence: `app.py`)
- Prediction dashboard → Probability pie chart: shows distribution (evidence: `app.py`)
- Prediction dashboard → Model metrics: shows metrics (evidence: `app.py`)
