# morshadul/customer-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/morshadul/customer-churn-prediction
- Repository: https://github.com/morshadul/customer-churn-prediction

## Overview

This repository is a Streamlit customer-churn prediction app. A user enters customer attributes; the app encodes categorical values, scales the assembled inputs, invokes a saved neural-network model, and displays a churn probability and classification. The graph focuses on this inference workflow. The README gives no further capability details, and the notebooks and training workflow were not sampled, so they are not mapped.

Main entry points: [`app.py`](https://github.com/morshadul/customer-churn-prediction/blob/main/app.py) (Input preparation), [`model.h5`](https://github.com/morshadul/customer-churn-prediction/blob/main/model.h5) (Churn model), [`label_encoder_gender.pkl`](https://github.com/morshadul/customer-churn-prediction/blob/main/label_encoder_gender.pkl) (Gender encoder), [`one_hot_encoder_geo.pkl`](https://github.com/morshadul/customer-churn-prediction/blob/main/one_hot_encoder_geo.pkl) (Geography encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_input["Customer inputs<br/>[app.py]"]
  node_result["Prediction display<br/>[app.py]"]
end

subgraph group_inference["Prediction"]
  node_gender_encoder["Gender encoder"]
  node_geo_encoder["Geography encoder"]
  node_preprocess["Input preparation<br/>[app.py]"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_model["Churn model<br/>[model.h5]"]
end

node_user(("User"))

node_user -->|"enters attributes"| node_input
node_input -->|"passes inputs"| node_preprocess
node_preprocess -->|"encodes gender"| node_gender_encoder
node_preprocess -->|"encodes geography"| node_geo_encoder
node_preprocess -->|"scales features"| node_scaler
node_preprocess -->|"predicts churn"| node_model
node_model -->|"returns probability"| node_result
node_result -->|"shows prediction"| node_user

click node_input "https://github.com/morshadul/customer-churn-prediction/blob/main/app.py"
click node_gender_encoder "https://github.com/morshadul/customer-churn-prediction/blob/main/label_encoder_gender.pkl"
click node_geo_encoder "https://github.com/morshadul/customer-churn-prediction/blob/main/one_hot_encoder_geo.pkl"
click node_preprocess "https://github.com/morshadul/customer-churn-prediction/blob/main/app.py"
click node_scaler "https://github.com/morshadul/customer-churn-prediction/blob/main/scaler.pkl"
click node_model "https://github.com/morshadul/customer-churn-prediction/blob/main/model.h5"
click node_result "https://github.com/morshadul/customer-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_input,node_result,node_user toneBlue
class node_gender_encoder,node_geo_encoder,node_preprocess,node_scaler,node_model toneAmber
```

## Components

### User interface

- [Customer inputs](https://github.com/morshadul/customer-churn-prediction/blob/main/app.py): `app.py`
- [Prediction display](https://github.com/morshadul/customer-churn-prediction/blob/main/app.py): `app.py`

### Prediction

- [Gender encoder](https://github.com/morshadul/customer-churn-prediction/blob/main/label_encoder_gender.pkl): `label_encoder_gender.pkl`
- [Geography encoder](https://github.com/morshadul/customer-churn-prediction/blob/main/one_hot_encoder_geo.pkl): `one_hot_encoder_geo.pkl`
- [Input preparation](https://github.com/morshadul/customer-churn-prediction/blob/main/app.py): `app.py`
- [Feature scaler](https://github.com/morshadul/customer-churn-prediction/blob/main/scaler.pkl): `scaler.pkl`
- [Churn model](https://github.com/morshadul/customer-churn-prediction/blob/main/model.h5): `model.h5`

### Other components

- **User**

## Connections

- User → Customer inputs: enters attributes
- Customer inputs → Input preparation: passes inputs
- Input preparation → Gender encoder: encodes gender
- Input preparation → Geography encoder: encodes geography
- Input preparation → Feature scaler: scales features
- Input preparation → Churn model: predicts churn
- Churn model → Prediction display: returns probability
- Prediction display → User: shows prediction
