# kothurigoutham/churn_prediction_c1 architecture

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

- Interactive diagram: https://gitdiagram.com/kothurigoutham/churn_prediction_c1
- Repository: https://github.com/kothurigoutham/churn_prediction_c1

## Overview

This is a telecom churn ML project with a Streamlit interface as its main user-facing product. Users enter customer details and receive a churn label, probability, risk level, and SHAP explanation; the app also presents dataset summaries and model insights. The training path cleans the Telco dataset, compares and tunes classifiers, and saves a reusable pipeline and reports. The README documents a separate notebook-based analysis workflow. Source excerpts show the app, training, preprocessing, and explanation modules; notebook internals were not sampled.

Main entry points: [`app/app.py`](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/app/app.py) (Churn app), [`src/train.py`](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/train.py) (Train and tune), [`data/primary/telco_churn.csv`](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/data/primary/telco_churn.csv) (Telco dataset), [`models/churn_pipeline.pkl`](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/models/churn_pipeline.pkl) (Saved pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Streamlit experience"]
  node_app["Churn app<br/>[app.py]"]
end

subgraph group_ml["Model workflow"]
  node_explain["SHAP explanations<br/>[explain.py]"]
  node_preprocess["Data preprocessing<br/>[preprocessing.py]"]
  node_train["Train and tune<br/>[train.py]"]
  node_predict["Prediction helper<br/>[predict.py]"]
end

subgraph group_assets["Data and artifacts"]
  node_dataset["Telco dataset<br/>[telco_churn.csv]"]
  node_pipeline["Saved pipeline<br/>[churn_pipeline.pkl]"]
  node_reports["Model reports"]
end

subgraph group_analysis["Notebook analysis"]
  node_notebook["Churn analysis"]
end

node_user(("Analyst"))

node_user -->|"enters details"| node_app
node_app -->|"loads pipeline"| node_pipeline
node_app -->|"loads background data"| node_dataset
node_app -->|"requests explanations"| node_explain
node_app -->|"reads model insights"| node_reports
node_train -->|"loads data"| node_dataset
node_train -->|"uses cleaning and transforms"| node_preprocess
node_train -->|"saves selected model"| node_pipeline
node_train -->|"writes metrics and summaries"| node_reports
node_notebook -->|"analyzes dataset"| node_dataset
node_notebook -->|"saves final pipeline"| node_pipeline

click node_app "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/app/app.py"
click node_explain "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/explain.py"
click node_preprocess "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/preprocessing.py"
click node_train "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/train.py"
click node_predict "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/predict.py"
click node_dataset "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/data/primary/telco_churn.csv"
click node_pipeline "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/models/churn_pipeline.pkl"
click node_reports "https://github.com/kothurigoutham/churn_prediction_c1/tree/master/models"
click node_notebook "https://github.com/kothurigoutham/churn_prediction_c1/blob/master/notebooks/churn_analysis.ipynb"

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 toneBlue
class node_explain,node_preprocess,node_train,node_predict toneAmber
class node_dataset,node_pipeline,node_reports toneMint
class node_notebook toneRose
class node_user toneIndigo
```

## Components

### Streamlit experience

- [Churn app](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/app/app.py): `app/app.py`

### Model workflow

- [SHAP explanations](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/explain.py): `src/explain.py`
- [Data preprocessing](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/preprocessing.py): `src/preprocessing.py`
- [Train and tune](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/train.py): `src/train.py`
- [Prediction helper](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/src/predict.py): `src/predict.py`

### Data and artifacts

- [Telco dataset](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/data/primary/telco_churn.csv): `data/primary/telco_churn.csv`
- [Saved pipeline](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/models/churn_pipeline.pkl): `models/churn_pipeline.pkl`
- [Model reports](https://github.com/kothurigoutham/churn_prediction_c1/tree/master/models): `models`

### Notebook analysis

- [Churn analysis](https://github.com/kothurigoutham/churn_prediction_c1/blob/master/notebooks/churn_analysis.ipynb): `notebooks/churn_analysis.ipynb`

### Other components

- **Analyst**

## Connections

- Analyst → Churn app: enters details (evidence: `README.md`)
- Churn app → Saved pipeline: loads pipeline (evidence: `README.md`)
- Churn app → Telco dataset: loads background data (evidence: `app/app.py`)
- Churn app → SHAP explanations: requests explanations (evidence: `app/app.py`)
- Churn app → Model reports: reads model insights (evidence: `app/app.py`)
- Train and tune → Telco dataset: loads data (evidence: `src/train.py`)
- Train and tune → Data preprocessing: uses cleaning and transforms (evidence: `src/train.py`)
- Train and tune → Saved pipeline: saves selected model (evidence: `src/train.py`)
- Train and tune → Model reports: writes metrics and summaries (evidence: `src/train.py`)
- Churn analysis → Telco dataset: analyzes dataset (evidence: `README.md`)
- Churn analysis → Saved pipeline: saves final pipeline (evidence: `README.md`)
