# wavetnsch/credit-scorecard-development architecture

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

- Interactive diagram: https://gitdiagram.com/wavetnsch/credit-scorecard-development
- Repository: https://github.com/wavetnsch/credit-scorecard-development

## Overview

This repository is a Python credit-scorecard development toolkit and notebook workflow. Its main path is to load and clean credit-bureau data, explore the portfolio, transform predictors with WoE/IV, fit a logistic-regression scorecard with PDO scaling, and evaluate discrimination and stability. Synthetic data generation is a separate fallback capability. The README documents the notebook stages and dataset; source excerpts show the implementation of the toolkit modules. The notebook itself was not sampled, so its internal calls are not asserted.

Main entry points: [`a_score_model.ipynb`](https://github.com/wavetnsch/credit-scorecard-development/blob/main/a_score_model.ipynb) (Development notebook), [`data`](https://github.com/wavetnsch/credit-scorecard-development/tree/main/data) (Local CSV data), [`src/data_loader.py`](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/data_loader.py) (Load and clean), [`src/scorecard.py`](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/scorecard.py) (Logistic scorecard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_local_data[("Local CSV data")]
  node_loader["Load and clean<br/>[data_loader.py]"]
  node_synthetic["Synthetic data<br/>[data_generator.py]"]
  node_eda["Portfolio EDA"]
end

subgraph group_model["Scorecard development"]
  node_workflow["Development notebook"]
  node_woe["WoE and IV<br/>[woe_iv.py]"]
  node_scorecard["Logistic scorecard<br/>[scorecard.py]"]
  node_scaling["PDO score scaling<br/>[scorecard.py]"]
end

subgraph group_evaluation["Model evaluation"]
  node_validation["Performance metrics<br/>[validation.py]"]
  node_stability["Population stability<br/>[validation.py]"]
end

node_analyst(("Analyst"))
node_kaggle[("Kaggle dataset")]

node_kaggle -->|"download dataset"| node_local_data
node_local_data -->|"read CSV"| node_loader
node_loader -->|"provide cleaned data"| node_workflow
node_synthetic -.->|"fallback data"| node_workflow
node_analyst -->|"run workflow"| node_workflow
node_workflow -->|"explore portfolio"| node_eda
node_workflow -->|"transform features"| node_woe
node_workflow -->|"fit model"| node_scorecard
node_scorecard -->|"map to points"| node_scaling
node_workflow -->|"evaluate model"| node_validation
node_workflow -->|"measure PSI"| node_stability

click node_local_data "https://github.com/wavetnsch/credit-scorecard-development/tree/main/data"
click node_loader "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/data_loader.py"
click node_synthetic "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/data_generator.py"
click node_workflow "https://github.com/wavetnsch/credit-scorecard-development/blob/main/a_score_model.ipynb"
click node_eda "https://github.com/wavetnsch/credit-scorecard-development/blob/main/a_score_model.ipynb"
click node_woe "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/woe_iv.py"
click node_scorecard "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/scorecard.py"
click node_scaling "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/scorecard.py"
click node_validation "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/validation.py"
click node_stability "https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/validation.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_local_data,node_loader,node_synthetic,node_eda toneBlue
class node_workflow,node_woe,node_scorecard,node_scaling,node_kaggle toneAmber
class node_validation,node_stability toneMint
class node_analyst toneIndigo
```

## Components

### Data preparation

- [Local CSV data](https://github.com/wavetnsch/credit-scorecard-development/tree/main/data): `data`
- [Load and clean](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/data_loader.py): `src/data_loader.py`
- [Synthetic data](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/data_generator.py): `src/data_generator.py`
- [Portfolio EDA](https://github.com/wavetnsch/credit-scorecard-development/blob/main/a_score_model.ipynb): `a_score_model.ipynb`

### Scorecard development

- [Development notebook](https://github.com/wavetnsch/credit-scorecard-development/blob/main/a_score_model.ipynb): `a_score_model.ipynb`
- [WoE and IV](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/woe_iv.py): `src/woe_iv.py`
- [Logistic scorecard](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/scorecard.py): `src/scorecard.py`
- [PDO score scaling](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/scorecard.py): `src/scorecard.py`

### Model evaluation

- [Performance metrics](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/validation.py): `src/validation.py`
- [Population stability](https://github.com/wavetnsch/credit-scorecard-development/blob/main/src/validation.py): `src/validation.py`

### Other components

- **Analyst**
- **Kaggle dataset**

## Connections

- Kaggle dataset → Local CSV data: download dataset (evidence: `README.md`)
- Local CSV data → Load and clean: read CSV (evidence: `src/data_loader.py`)
- Load and clean → Development notebook: provide cleaned data (evidence: `README.md`)
- Synthetic data → Development notebook: fallback data (evidence: `README.md`)
- Analyst → Development notebook: run workflow (evidence: `README.md`)
- Development notebook → Portfolio EDA: explore portfolio (evidence: `README.md`)
- Development notebook → WoE and IV: transform features (evidence: `README.md`)
- Development notebook → Logistic scorecard: fit model (evidence: `README.md`)
- Logistic scorecard → PDO score scaling: map to points (evidence: `src/scorecard.py`)
- Development notebook → Performance metrics: evaluate model (evidence: `README.md`)
- Development notebook → Population stability: measure PSI (evidence: `README.md`)
