# codeplaydeepak/customer_churn_prediction architecture

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

- Interactive diagram: https://gitdiagram.com/codeplaydeepak/customer_churn_prediction
- Repository: https://github.com/codeplaydeepak/customer_churn_prediction

## Overview

This is a customer-churn analytics product with a React dashboard and a separate Python training/prediction application. Users explore customer data, inspect engineered features and model performance, then assess individual or batch churn risk and business implications. The Python workflow loads or generates data, engineers features, preprocesses them, trains candidate models, and evaluates results. The dashboard also presents explainability, research, and model-comparison capabilities. Some frontend-to-engine and Python pipeline links are only indicated by module references, so those edges are marked unverified rather than asserted as direct calls.

Main entry points: [`src/App.tsx`](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/App.tsx) (Dashboard app), [`src/mlEngine.ts`](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/mlEngine.ts) (Risk engine), [`customer-churn-prediction/streamlit_app.py`](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/streamlit_app.py) (Streamlit and CLI), [`customer-churn-prediction/src/train.py`](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/train.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard workflow"]
  node_app["Dashboard app<br/>[App.tsx]"]
  node_dataset["Dataset view<br/>[DatasetView.tsx]"]
  node_quality["Data quality"]
  node_eda["Data exploration<br/>[EDAView.tsx]"]
  node_features_ui["Feature engineering view"]
  node_training_ui["Training view"]
  node_comparison["Model comparison"]
  node_evaluation_ui["Evaluation view<br/>[EvaluationView.tsx]"]
  node_prediction_ui["Prediction view<br/>[PredictionView.tsx]"]
  node_batch_ui["Batch prediction"]
  node_dashboard_view["Summary dashboard<br/>[DashboardView.tsx]"]
  node_engine["Risk engine<br/>[mlEngine.ts]"]
end

subgraph group_insights["Analysis and insights"]
  node_baseline["Baseline data<br/>[baselineData.ts]"]
  node_explain_ui["Explainability view"]
  node_risk_ui["Risk analysis view"]
  node_business["Business insights"]
  node_research["Research view<br/>[ResearchView.tsx]"]
end

subgraph group_python["Python ML pipeline"]
  node_loader["Data loading<br/>[data_loader.py]"]
  node_feature_engineering["Feature engineering"]
  node_preprocessing["Preprocessing<br/>[preprocessing.py]"]
  node_training["Model training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_prediction["Prediction service<br/>[prediction.py]"]
  node_explainability["Model explainability<br/>[explainability.py]"]
  node_risk_analysis["Risk analysis<br/>[risk_analysis.py]"]
  node_artifacts[("Model artifacts")]
end

subgraph group_python_ui["Python application"]
  node_python_app["Streamlit and CLI<br/>[streamlit_app.py]"]
end

node_user(("Analyst"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dataset
node_app -->|"renders"| node_quality
node_app -->|"renders"| node_eda
node_app -->|"renders"| node_features_ui
node_app -->|"renders"| node_training_ui
node_app -->|"renders"| node_comparison
node_app -->|"renders"| node_evaluation_ui
node_app -->|"renders"| node_prediction_ui
node_app -->|"renders"| node_batch_ui
node_app -->|"renders"| node_dashboard_view
node_app -->|"renders"| node_explain_ui
node_app -->|"renders"| node_risk_ui
node_app -->|"renders"| node_business
node_app -->|"renders"| node_research
node_app -->|"loads"| node_baseline
node_features_ui -->|"calculates with"| node_engine
node_dataset -.->|"uses"| node_engine
node_quality -.->|"uses"| node_engine
node_dashboard_view -.->|"uses"| node_engine
node_prediction_ui -.->|"uses"| node_engine
node_batch_ui -.->|"uses"| node_engine
node_risk_ui -.->|"uses"| node_engine
node_explain_ui -.->|"uses"| node_engine
node_python_app -->|"loads data"| node_loader
node_python_app -->|"engineers features"| node_feature_engineering
node_python_app -->|"requests predictions"| node_prediction
node_python_app -->|"starts training"| node_training
node_python_app -->|"evaluates model"| node_evaluation
node_training -->|"generates data"| node_loader
node_training -.->|"engineers features"| node_feature_engineering
node_training -->|"builds pipeline"| node_preprocessing
node_training -->|"scores models"| node_evaluation
node_training -->|"saves models"| node_artifacts
node_prediction -.->|"engineers features"| node_feature_engineering
node_python_app -.->|"uses models"| node_artifacts
node_explainability -.->|"uses"| node_preprocessing

click node_app "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/App.tsx"
click node_dataset "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DatasetView.tsx"
click node_quality "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DataQualityView.tsx"
click node_eda "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/EDAView.tsx"
click node_features_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/FeatureEngineeringView.tsx"
click node_training_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ModelTrainingView.tsx"
click node_comparison "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ModelComparisonView.tsx"
click node_evaluation_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/EvaluationView.tsx"
click node_prediction_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/PredictionView.tsx"
click node_batch_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/BatchPredictionView.tsx"
click node_dashboard_view "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DashboardView.tsx"
click node_engine "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/mlEngine.ts"
click node_baseline "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/data/baselineData.ts"
click node_explain_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ExplainabilityView.tsx"
click node_risk_ui "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/RiskAnalysisView.tsx"
click node_business "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/BusinessInsightsView.tsx"
click node_research "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ResearchView.tsx"
click node_loader "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/data_loader.py"
click node_feature_engineering "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/feature_engineering.py"
click node_preprocessing "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/preprocessing.py"
click node_training "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/train.py"
click node_evaluation "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/evaluation.py"
click node_prediction "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/prediction.py"
click node_explainability "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/explainability.py"
click node_risk_analysis "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/risk_analysis.py"
click node_artifacts "https://github.com/codeplaydeepak/customer_churn_prediction/tree/main/customer-churn-prediction/models"
click node_python_app "https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/streamlit_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_dataset,node_quality,node_eda,node_features_ui,node_training_ui,node_comparison,node_evaluation_ui,node_prediction_ui,node_batch_ui,node_dashboard_view,node_engine toneBlue
class node_baseline,node_explain_ui,node_risk_ui,node_business,node_research toneAmber
class node_loader,node_feature_engineering,node_preprocessing,node_training,node_evaluation,node_prediction,node_explainability,node_risk_analysis,node_artifacts toneMint
class node_python_app toneRose
class node_user toneIndigo
```

## Components

### Dashboard workflow

- [Dashboard app](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/App.tsx): `src/App.tsx`
- [Dataset view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DatasetView.tsx): `src/components/DatasetView.tsx`
- [Data quality](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DataQualityView.tsx): `src/components/DataQualityView.tsx`
- [Data exploration](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/EDAView.tsx): `src/components/EDAView.tsx`
- [Feature engineering view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/FeatureEngineeringView.tsx): `src/components/FeatureEngineeringView.tsx`
- [Training view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ModelTrainingView.tsx): `src/components/ModelTrainingView.tsx`
- [Model comparison](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ModelComparisonView.tsx): `src/components/ModelComparisonView.tsx`
- [Evaluation view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/EvaluationView.tsx): `src/components/EvaluationView.tsx`
- [Prediction view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/PredictionView.tsx): `src/components/PredictionView.tsx`
- [Batch prediction](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/BatchPredictionView.tsx): `src/components/BatchPredictionView.tsx`
- [Summary dashboard](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Risk engine](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/mlEngine.ts): `src/mlEngine.ts`

### Analysis and insights

- [Baseline data](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/data/baselineData.ts): `src/data/baselineData.ts`
- [Explainability view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ExplainabilityView.tsx): `src/components/ExplainabilityView.tsx`
- [Risk analysis view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/RiskAnalysisView.tsx): `src/components/RiskAnalysisView.tsx`
- [Business insights](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/BusinessInsightsView.tsx): `src/components/BusinessInsightsView.tsx`
- [Research view](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/src/components/ResearchView.tsx): `src/components/ResearchView.tsx`

### Python ML pipeline

- [Data loading](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/data_loader.py): `customer-churn-prediction/src/data_loader.py`
- [Feature engineering](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/feature_engineering.py): `customer-churn-prediction/src/feature_engineering.py`
- [Preprocessing](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/preprocessing.py): `customer-churn-prediction/src/preprocessing.py`
- [Model training](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/train.py): `customer-churn-prediction/src/train.py`
- [Model evaluation](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/evaluation.py): `customer-churn-prediction/src/evaluation.py`
- [Prediction service](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/prediction.py): `customer-churn-prediction/src/prediction.py`
- [Model explainability](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/explainability.py): `customer-churn-prediction/src/explainability.py`
- [Risk analysis](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/src/risk_analysis.py): `customer-churn-prediction/src/risk_analysis.py`
- [Model artifacts](https://github.com/codeplaydeepak/customer_churn_prediction/tree/main/customer-churn-prediction/models): `customer-churn-prediction/models`

### Python application

- [Streamlit and CLI](https://github.com/codeplaydeepak/customer_churn_prediction/blob/main/customer-churn-prediction/streamlit_app.py): `customer-churn-prediction/streamlit_app.py`

### Other components

- **Analyst**

## Connections

- Analyst → Dashboard app: uses (evidence: `README.md`)
- Dashboard app → Dataset view: renders (evidence: `src/App.tsx`)
- Dashboard app → Data quality: renders (evidence: `src/App.tsx`)
- Dashboard app → Data exploration: renders (evidence: `src/App.tsx`)
- Dashboard app → Feature engineering view: renders (evidence: `src/App.tsx`)
- Dashboard app → Training view: renders (evidence: `src/App.tsx`)
- Dashboard app → Model comparison: renders (evidence: `src/App.tsx`)
- Dashboard app → Evaluation view: renders (evidence: `src/App.tsx`)
- Dashboard app → Prediction view: renders (evidence: `src/App.tsx`)
- Dashboard app → Batch prediction: renders (evidence: `src/App.tsx`)
- Dashboard app → Summary dashboard: renders (evidence: `src/App.tsx`)
- Dashboard app → Explainability view: renders (evidence: `src/App.tsx`)
- Dashboard app → Risk analysis view: renders (evidence: `src/App.tsx`)
- Dashboard app → Business insights: renders (evidence: `src/App.tsx`)
- Dashboard app → Research view: renders (evidence: `src/App.tsx`)
- Dashboard app → Baseline data: loads (evidence: `src/App.tsx`)
- Feature engineering view → Risk engine: calculates with (evidence: `src/components/FeatureEngineeringView.tsx`)
- Dataset view → Risk engine: uses (evidence: `src/components/DatasetView.tsx`)
- Data quality → Risk engine: uses (evidence: `src/components/DataQualityView.tsx`)
- Summary dashboard → Risk engine: uses (evidence: `src/components/DashboardView.tsx`)
- Prediction view → Risk engine: uses (evidence: `src/components/PredictionView.tsx`)
- Batch prediction → Risk engine: uses (evidence: `src/components/BatchPredictionView.tsx`)
- Risk analysis view → Risk engine: uses (evidence: `src/components/RiskAnalysisView.tsx`)
- Explainability view → Risk engine: uses (evidence: `src/components/ExplainabilityView.tsx`)
- Streamlit and CLI → Data loading: loads data (evidence: `customer-churn-prediction/streamlit_app.py`)
- Streamlit and CLI → Feature engineering: engineers features (evidence: `customer-churn-prediction/streamlit_app.py`)
- Streamlit and CLI → Prediction service: requests predictions (evidence: `customer-churn-prediction/streamlit_app.py`)
- Streamlit and CLI → Model training: starts training (evidence: `customer-churn-prediction/streamlit_app.py`)
- Streamlit and CLI → Model evaluation: evaluates model (evidence: `customer-churn-prediction/streamlit_app.py`)
- Model training → Data loading: generates data (evidence: `customer-churn-prediction/src/train.py`)
- Model training → Feature engineering: engineers features (evidence: `customer-churn-prediction/src/train.py`)
- Model training → Preprocessing: builds pipeline (evidence: `customer-churn-prediction/src/train.py`)
- Model training → Model evaluation: scores models (evidence: `customer-churn-prediction/src/train.py`)
- Model training → Model artifacts: saves models (evidence: `customer-churn-prediction/src/train.py`)
- Prediction service → Feature engineering: engineers features (evidence: `customer-churn-prediction/src/prediction.py`)
- Streamlit and CLI → Model artifacts: uses models
- Model explainability → Preprocessing: uses (evidence: `customer-churn-prediction/src/explainability.py`)
