# atharv-1905/ibm-customer-churn-mlops architecture

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

- Interactive diagram: https://gitdiagram.com/atharv-1905/ibm-customer-churn-mlops
- Repository: https://github.com/atharv-1905/ibm-customer-churn-mlops

## Overview

This repository develops a churn classifier and serves predictions through a FastAPI endpoint. The training script loads the Telco spreadsheet, selects and preprocesses features, fits and evaluates a Logistic Regression pipeline, logs the run to MLflow, and saves the model for serving. The README documents Docker and Kubernetes deployment. The API and prediction implementation were not excerpted, so their internal calls are shown only where the README explicitly describes them; deployment links are likewise documentation-based.

Main entry points: [`api/app.py`](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/api/app.py) (FastAPI service), [`src/train.py`](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py) (Model training), [`Dockerfile`](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/Dockerfile) (Docker image), [`k8s`](https://github.com/atharv-1905/ibm-customer-churn-mlops/tree/master/k8s) (Kubernetes deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Model development"]
  node_dataset["Churn dataset"]
  node_feature_prep["Feature preparation<br/>[train.py]"]
  node_model_training["Model training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[train.py]"]
  node_saved_model["Saved pipeline<br/>[model.pkl]"]
end

subgraph group_serving["Prediction service"]
  node_api["FastAPI service<br/>[app.py]"]
  node_prediction["Prediction logic<br/>[predict.py]"]
end

subgraph group_deployment["Deployment"]
  node_docker["Docker image"]
  node_kubernetes["Kubernetes deployment"]
end

subgraph group_tracking["Experiment tracking"]
  node_experiment["MLflow tracking"]
end

node_user(("API client"))
node_deployment_user(("Deployment operator"))

node_dataset -->|"provides data"| node_feature_prep
node_feature_prep -->|"prepares features"| node_model_training
node_model_training -->|"predicts test set"| node_evaluation
node_model_training -->|"logs run"| node_experiment
node_model_training -->|"saves pipeline"| node_saved_model
node_user -->|"requests prediction"| node_api
node_api -->|"uses prediction logic"| node_prediction
node_api -->|"loads model"| node_saved_model
node_api -->|"returns prediction"| node_user
node_deployment_user -->|"builds image"| node_docker
node_docker -->|"packages service"| node_api
node_deployment_user -->|"applies manifests"| node_kubernetes
node_kubernetes -->|"deploys service"| node_api

click node_dataset "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/data/Telco_customer_churn.xlsx"
click node_feature_prep "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py"
click node_model_training "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py"
click node_evaluation "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py"
click node_saved_model "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/model/model.pkl"
click node_api "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/api/app.py"
click node_prediction "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/predict.py"
click node_docker "https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/Dockerfile"
click node_kubernetes "https://github.com/atharv-1905/ibm-customer-churn-mlops/tree/master/k8s"

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_dataset,node_feature_prep,node_model_training,node_evaluation,node_saved_model,node_user toneBlue
class node_api,node_prediction toneAmber
class node_docker,node_kubernetes toneMint
class node_experiment toneRose
class node_deployment_user toneIndigo
```

## Components

### Model development

- [Churn dataset](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/data/Telco_customer_churn.xlsx): `data/Telco_customer_churn.xlsx`
- [Feature preparation](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py): `src/train.py`
- [Model training](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py): `src/train.py`
- [Model evaluation](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/train.py): `src/train.py`
- [Saved pipeline](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/model/model.pkl): `model/model.pkl`

### Prediction service

- [FastAPI service](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/api/app.py): `api/app.py`
- [Prediction logic](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/src/predict.py): `src/predict.py`

### Deployment

- [Docker image](https://github.com/atharv-1905/ibm-customer-churn-mlops/blob/master/Dockerfile): `Dockerfile`
- [Kubernetes deployment](https://github.com/atharv-1905/ibm-customer-churn-mlops/tree/master/k8s): `k8s`

### Experiment tracking

- **MLflow tracking**

### Other components

- **API client**
- **Deployment operator**

## Connections

- Churn dataset → Feature preparation: provides data (evidence: `src/train.py`)
- Feature preparation → Model training: prepares features (evidence: `src/train.py`)
- Model training → Model evaluation: predicts test set (evidence: `src/train.py`)
- Model training → MLflow tracking: logs run (evidence: `src/train.py`)
- Model training → Saved pipeline: saves pipeline (evidence: `src/train.py`)
- API client → FastAPI service: requests prediction (evidence: `README.md`)
- FastAPI service → Prediction logic: uses prediction logic (evidence: `README.md`)
- FastAPI service → Saved pipeline: loads model (evidence: `README.md`)
- FastAPI service → API client: returns prediction (evidence: `README.md`)
- Deployment operator → Docker image: builds image (evidence: `README.md`)
- Docker image → FastAPI service: packages service (evidence: `README.md`)
- Deployment operator → Kubernetes deployment: applies manifests (evidence: `README.md`)
- Kubernetes deployment → FastAPI service: deploys service (evidence: `README.md`)
