# mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card architecture

> Architecture diagram of the GitHub repository mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card, 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/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card
- Repository: https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card

## Overview

This repository documents an offline customer-churn modeling workflow, not a serving API: a notebook preprocesses customer data, trains and evaluates candidate models, analyzes thresholds and errors, and saves model and metric artifacts. The README documents the workflow and reports, but no source excerpts or dataset are present, so the graph reflects documented stages and outputs rather than verified implementation calls.

Main entry points: [`churn_model.ipynb`](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb) (Model Evaluation), [`error_analysis.md`](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/error_analysis.md) (Error Report), [`model_card.md`](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/model_card.md) (Model Card), [`Models/gradient_boosting.pkl`](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/Models/gradient_boosting.pkl) (Saved Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Modeling Workflow"]
  node_notebook["Modeling Notebook<br/>[churn_model.ipynb]"]
  node_preprocessing["Preprocessing<br/>[churn_model.ipynb]"]
  node_training["Model Training<br/>[churn_model.ipynb]"]
  node_evaluation["Model Evaluation<br/>[churn_model.ipynb]"]
  node_thresholds["Threshold Analysis<br/>[churn_model.ipynb]"]
  node_error_stage["Error Analysis<br/>[churn_model.ipynb]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_saved_models["Saved Models"]
  node_model_comparison["Model Comparison"]
  node_metrics["Evaluation Metrics<br/>[metrics.json]"]
end

subgraph group_analysis["Analysis Reports"]
  node_error_report["Error Report<br/>[error_analysis.md]"]
end

subgraph group_documentation["Model Documentation"]
  node_model_card["Model Card<br/>[model_card.md]"]
end

node_analyst(("Analyst"))
node_customer_data[("Customer Dataset")]
node_retention_team(("Retention Team"))

node_analyst -->|"runs"| node_notebook
node_customer_data -->|"provides data"| node_preprocessing
node_notebook -->|"performs"| node_preprocessing
node_preprocessing -->|"prepared data"| node_training
node_training -->|"trained models"| node_evaluation
node_evaluation -->|"evaluated models"| node_thresholds
node_thresholds -->|"selected threshold"| node_error_stage
node_training -->|"saves models"| node_saved_models
node_evaluation -->|"records comparison"| node_model_comparison
node_evaluation -->|"records metrics"| node_metrics
node_error_stage -->|"documents findings"| node_error_report
node_analyst -->|"documents model"| node_model_card
node_model_card -.->|"communicates use"| node_retention_team
node_error_report -.->|"communicates risks"| node_retention_team

click node_notebook "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_preprocessing "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_training "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_evaluation "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_thresholds "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_error_stage "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb"
click node_saved_models "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/Models/gradient_boosting.pkl"
click node_model_comparison "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/Part_3_outputs/model_comparison.csv"
click node_metrics "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/metrics.json"
click node_error_report "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/error_analysis.md"
click node_model_card "https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/model_card.md"

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_notebook,node_preprocessing,node_training,node_evaluation,node_thresholds,node_error_stage toneBlue
class node_saved_models,node_model_comparison,node_metrics,node_customer_data toneAmber
class node_error_report toneMint
class node_model_card toneRose
class node_analyst,node_retention_team toneIndigo
```

## Components

### Modeling Workflow

- [Modeling Notebook](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`
- [Preprocessing](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`
- [Model Training](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`
- [Model Evaluation](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`
- [Threshold Analysis](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`
- [Error Analysis](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/churn_model.ipynb): `churn_model.ipynb`

### Model Artifacts

- [Saved Models](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/Models/gradient_boosting.pkl): `Models/gradient_boosting.pkl`
- [Model Comparison](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/Part_3_outputs/model_comparison.csv): `Part_3_outputs/model_comparison.csv`
- [Evaluation Metrics](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/metrics.json): `metrics.json`

### Analysis Reports

- [Error Report](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/error_analysis.md): `error_analysis.md`

### Model Documentation

- [Model Card](https://github.com/mayanksharma1007/d2c-customer-churn-part-3-churn-prediction-model---model-card/blob/main/model_card.md): `model_card.md`

### Other components

- **Analyst**
- **Customer Dataset**
- **Retention Team**

## Connections

- Analyst → Modeling Notebook: runs
- Customer Dataset → Preprocessing: provides data
- Modeling Notebook → Preprocessing: performs
- Preprocessing → Model Training: prepared data
- Model Training → Model Evaluation: trained models
- Model Evaluation → Threshold Analysis: evaluated models
- Threshold Analysis → Error Analysis: selected threshold
- Model Training → Saved Models: saves models
- Model Evaluation → Model Comparison: records comparison
- Model Evaluation → Evaluation Metrics: records metrics
- Error Analysis → Error Report: documents findings
- Analyst → Model Card: documents model
- Model Card → Retention Team: communicates use
- Error Report → Retention Team: communicates risks
