# chandanc5525/telecom_customerchurn_predictionmodel architecture

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

- Interactive diagram: https://gitdiagram.com/chandanc5525/telecom_customerchurn_predictionmodel
- Repository: https://github.com/chandanc5525/telecom_customerchurn_predictionmodel

## Overview

This repository trains a telecom churn classifier and serves predictions through a Streamlit form. The training workflow reads the churn dataset, prepares and reduces features, trains and evaluates an AutoML classifier, then saves the model package. The deployment app loads that package and applies the saved preprocessing, dimensionality reduction, and classifier to customer inputs. The README also describes experiment tracking and model versioning; sampled code shows MLflow logging and DagsHub initialization, but not a separate version-management workflow.

Main entry points: [`src/model_building.py`](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py) (Model building), [`Deployment/app.py`](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py) (Prediction form), [`models/churn_model.pkl`](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/models/churn_model.pkl) (Model package), [`main.py`](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/main.py) (Training entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_entry["Training entry<br/>[main.py]"]
  node_ingestion["Data ingestion<br/>[data_ingestion.py]"]
  node_preprocessing["Feature preparation"]
  node_split["Train test split"]
  node_encoding["Impute and encode"]
  node_balancing["Class balancing"]
  node_reduction["SVD reduction"]
  node_builder["Model building<br/>[model_building.py]"]
  node_automl["AutoML training<br/>[model_building.py]"]
  node_evaluation["Model evaluation<br/>[model_building.py]"]
  node_artifact["Model package<br/>[churn_model.pkl]"]
end

subgraph group_serving["Prediction serving"]
  node_ui["Prediction form<br/>[app.py]"]
  node_prep_runtime["Saved preprocessor<br/>[app.py]"]
  node_svd_runtime["Saved SVD<br/>[app.py]"]
  node_predictor["Churn prediction<br/>[app.py]"]
end

subgraph group_tracking["Experiment tracking"]
  node_dagshub["DagsHub service"]
  node_mlflow["MLflow tracking"]
end

node_user(("Retention user"))
node_dataset["Churn dataset<br/>[churn.csv]"]

node_user -->|"enters customer details"| node_ui
node_ui -->|"loads package"| node_artifact
node_entry -->|"calls ingestion"| node_ingestion
node_ingestion -->|"reads CSV"| node_dataset
node_entry -->|"calls preprocessing"| node_preprocessing
node_preprocessing -->|"splits data"| node_split
node_split -->|"transforms features"| node_encoding
node_encoding -->|"resamples training data"| node_balancing
node_balancing -->|"reduces features"| node_reduction
node_entry -->|"calls model building"| node_builder
node_builder -->|"trains classifier"| node_automl
node_builder -->|"evaluates classifier"| node_evaluation
node_builder -->|"initializes tracking"| node_dagshub
node_builder -->|"logs run and metrics"| node_mlflow
node_builder -->|"writes package"| node_artifact
node_artifact -->|"provides preprocessor"| node_prep_runtime
node_artifact -->|"provides SVD"| node_svd_runtime
node_artifact -->|"provides classifier"| node_predictor
node_ui -->|"transforms input"| node_prep_runtime
node_ui -->|"reduces input"| node_svd_runtime
node_ui -->|"predicts churn"| node_predictor

click node_dataset "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/data/churn.csv"
click node_entry "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/main.py"
click node_ingestion "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_ingestion.py"
click node_preprocessing "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py"
click node_split "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py"
click node_encoding "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py"
click node_balancing "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py"
click node_reduction "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py"
click node_builder "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py"
click node_automl "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py"
click node_evaluation "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py"
click node_artifact "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/models/churn_model.pkl"
click node_ui "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py"
click node_prep_runtime "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py"
click node_svd_runtime "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py"
click node_predictor "https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/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_entry,node_ingestion,node_preprocessing,node_split,node_encoding,node_balancing,node_reduction,node_builder,node_automl,node_evaluation,node_artifact,node_user toneBlue
class node_ui,node_prep_runtime,node_svd_runtime,node_predictor toneAmber
class node_dagshub,node_mlflow toneMint
class node_dataset toneTeal
```

## Components

### Model training

- [Training entry](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/main.py): `main.py`
- [Data ingestion](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_ingestion.py): `src/data_ingestion.py`
- [Feature preparation](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Train test split](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Impute and encode](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Class balancing](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [SVD reduction](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Model building](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py): `src/model_building.py`
- [AutoML training](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py): `src/model_building.py`
- [Model evaluation](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/src/model_building.py): `src/model_building.py`
- [Model package](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/models/churn_model.pkl): `models/churn_model.pkl`

### Prediction serving

- [Prediction form](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py): `Deployment/app.py`
- [Saved preprocessor](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py): `Deployment/app.py`
- [Saved SVD](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py): `Deployment/app.py`
- [Churn prediction](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/Deployment/app.py): `Deployment/app.py`

### Experiment tracking

- **DagsHub service**
- **MLflow tracking**

### Other components

- **Retention user**
- [Churn dataset](https://github.com/chandanc5525/telecom_customerchurn_predictionmodel/blob/main/data/churn.csv): `data/churn.csv`

## Connections

- Retention user → Prediction form: enters customer details
- Prediction form → Model package: loads package
- Training entry → Data ingestion: calls ingestion
- Data ingestion → Churn dataset: reads CSV
- Training entry → Feature preparation: calls preprocessing
- Feature preparation → Train test split: splits data
- Train test split → Impute and encode: transforms features
- Impute and encode → Class balancing: resamples training data
- Class balancing → SVD reduction: reduces features
- Training entry → Model building: calls model building
- Model building → AutoML training: trains classifier
- Model building → Model evaluation: evaluates classifier
- Model building → DagsHub service: initializes tracking
- Model building → MLflow tracking: logs run and metrics
- Model building → Model package: writes package
- Model package → Saved preprocessor: provides preprocessor
- Model package → Saved SVD: provides SVD
- Model package → Churn prediction: provides classifier
- Prediction form → Saved preprocessor: transforms input
- Prediction form → Saved SVD: reduces input
- Prediction form → Churn prediction: predicts churn
