# phamtiendung1304/hybrid-credit-scoring-vietnam architecture

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

- Interactive diagram: https://gitdiagram.com/phamtiendung1304/hybrid-credit-scoring-vietnam
- Repository: https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam

## Overview

This research toolkit assesses credit risk for Vietnamese Gen Z thin-file applicants by combining traditional CIC bureau features with digital behavioral signals. Its documented workflow runs from synthetic or proprietary data through cleaning and feature construction to model training, evaluation, and interpretation. The repository has no sampled top-level workflow orchestrator, so the graph does not assert one. Model variants and calibration are included as documented capabilities; some connections to those unsampled implementations remain unverified.

Main entry points: [`hybrid-credit-scoring-vietnam/src/models/xgboost_model.py`](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/xgboost_model.py) (Hybrid XGBoost), [`hybrid-credit-scoring-vietnam/src/evaluation/metrics.py`](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/evaluation/metrics.py) (Credit metrics), [`hybrid-credit-scoring-vietnam/src/models/base_model.py`](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/base_model.py) (Model interface), [`hybrid-credit-scoring-vietnam/src/data/cleaner.py`](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/cleaner.py) (Data cleaner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_synthetic_data["Synthetic generator"]
  node_data_loader["Data loader<br/>[loader.py]"]
  node_cleaner["Data cleaner<br/>[cleaner.py]"]
end

subgraph group_features["Feature engineering"]
  node_bureau_features["Bureau features"]
  node_behavior_features["Behavioral features"]
  node_feature_selector["Feature selection"]
end

subgraph group_models["Scoring models"]
  node_base_model["Model interface<br/>[base_model.py]"]
  node_xgboost_model["Hybrid XGBoost<br/>[xgboost_model.py]"]
  node_logistic_model["Logistic regression<br/>[logistic_model.py]"]
  node_random_forest["Random forest"]
  node_lightgbm_model["LightGBM<br/>[lightgbm_model.py]"]
end

subgraph group_analysis["Evaluation and interpretation"]
  node_metrics["Credit metrics<br/>[metrics.py]"]
  node_calibration["Calibration<br/>[calibration.py]"]
  node_eda_plots["EDA plots<br/>[eda_plots.py]"]
  node_model_plots["Model plots<br/>[model_plots.py]"]
  node_shap_plots["SHAP analysis<br/>[shap_plots.py]"]
end

node_researcher(("Researcher"))
node_credit_data["Credit data"]

node_researcher -->|"generates sample data"| node_synthetic_data
node_researcher -->|"supplies proprietary data"| node_credit_data
node_credit_data -.->|"loads data"| node_data_loader
node_synthetic_data -.->|"may load generated data"| node_data_loader
node_data_loader -.->|"provides records"| node_cleaner
node_cleaner -.->|"prepares bureau inputs"| node_bureau_features
node_cleaner -.->|"prepares behavioral inputs"| node_behavior_features
node_bureau_features -.->|"selects predictive features"| node_feature_selector
node_behavior_features -.->|"selects predictive features"| node_feature_selector
node_base_model -->|"implemented by"| node_xgboost_model
node_base_model -->|"implemented by"| node_logistic_model
node_base_model -->|"implemented by"| node_random_forest
node_base_model -->|"implemented by"| node_lightgbm_model
node_feature_selector -.->|"provides selected features"| node_xgboost_model
node_xgboost_model -->|"evaluated with metrics"| node_metrics
node_logistic_model -->|"benchmarked with metrics"| node_metrics
node_random_forest -->|"benchmarked with metrics"| node_metrics
node_lightgbm_model -->|"benchmarked with metrics"| node_metrics
node_xgboost_model -->|"assessed for calibration"| node_calibration
node_metrics -.->|"visualizes evaluation"| node_model_plots
node_xgboost_model -->|"interpreted with SHAP"| node_shap_plots
node_credit_data -.->|"explored with plots"| node_eda_plots

click node_synthetic_data "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/synthetic_generator.py"
click node_data_loader "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/loader.py"
click node_cleaner "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/cleaner.py"
click node_bureau_features "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/traditional_features.py"
click node_behavior_features "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/behavioral_features.py"
click node_feature_selector "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/feature_selector.py"
click node_base_model "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/base_model.py"
click node_xgboost_model "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/xgboost_model.py"
click node_logistic_model "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/logistic_model.py"
click node_random_forest "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/random_forest_model.py"
click node_lightgbm_model "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/lightgbm_model.py"
click node_metrics "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/evaluation/metrics.py"
click node_calibration "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/evaluation/calibration.py"
click node_eda_plots "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/eda_plots.py"
click node_model_plots "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/model_plots.py"
click node_shap_plots "https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/shap_plots.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_synthetic_data,node_data_loader,node_cleaner toneBlue
class node_bureau_features,node_behavior_features,node_feature_selector toneAmber
class node_base_model,node_xgboost_model,node_logistic_model,node_random_forest,node_lightgbm_model toneMint
class node_metrics,node_calibration,node_eda_plots,node_model_plots,node_shap_plots toneRose
class node_researcher,node_credit_data toneIndigo
```

## Components

### Data preparation

- [Synthetic generator](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/synthetic_generator.py): `hybrid-credit-scoring-vietnam/src/data/synthetic_generator.py`
- [Data loader](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/loader.py): `hybrid-credit-scoring-vietnam/src/data/loader.py`
- [Data cleaner](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/data/cleaner.py): `hybrid-credit-scoring-vietnam/src/data/cleaner.py`

### Feature engineering

- [Bureau features](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/traditional_features.py): `hybrid-credit-scoring-vietnam/src/features/traditional_features.py`
- [Behavioral features](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/behavioral_features.py): `hybrid-credit-scoring-vietnam/src/features/behavioral_features.py`
- [Feature selection](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/features/feature_selector.py): `hybrid-credit-scoring-vietnam/src/features/feature_selector.py`

### Scoring models

- [Model interface](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/base_model.py): `hybrid-credit-scoring-vietnam/src/models/base_model.py`
- [Hybrid XGBoost](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/xgboost_model.py): `hybrid-credit-scoring-vietnam/src/models/xgboost_model.py`
- [Logistic regression](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/logistic_model.py): `hybrid-credit-scoring-vietnam/src/models/logistic_model.py`
- [Random forest](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/random_forest_model.py): `hybrid-credit-scoring-vietnam/src/models/random_forest_model.py`
- [LightGBM](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/models/lightgbm_model.py): `hybrid-credit-scoring-vietnam/src/models/lightgbm_model.py`

### Evaluation and interpretation

- [Credit metrics](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/evaluation/metrics.py): `hybrid-credit-scoring-vietnam/src/evaluation/metrics.py`
- [Calibration](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/evaluation/calibration.py): `hybrid-credit-scoring-vietnam/src/evaluation/calibration.py`
- [EDA plots](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/eda_plots.py): `hybrid-credit-scoring-vietnam/src/visualization/eda_plots.py`
- [Model plots](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/model_plots.py): `hybrid-credit-scoring-vietnam/src/visualization/model_plots.py`
- [SHAP analysis](https://github.com/phamtiendung1304/hybrid-credit-scoring-vietnam/blob/main/hybrid-credit-scoring-vietnam/src/visualization/shap_plots.py): `hybrid-credit-scoring-vietnam/src/visualization/shap_plots.py`

### Other components

- **Researcher**
- **Credit data**

## Connections

- Researcher → Synthetic generator: generates sample data (evidence: `hybrid-credit-scoring-vietnam/src/data/synthetic_generator.py`)
- Researcher → Credit data: supplies proprietary data
- Credit data → Data loader: loads data
- Synthetic generator → Data loader: may load generated data
- Data loader → Data cleaner: provides records
- Data cleaner → Bureau features: prepares bureau inputs
- Data cleaner → Behavioral features: prepares behavioral inputs
- Bureau features → Feature selection: selects predictive features
- Behavioral features → Feature selection: selects predictive features
- Model interface → Hybrid XGBoost: implemented by (evidence: `hybrid-credit-scoring-vietnam/src/models/xgboost_model.py`)
- Model interface → Logistic regression: implemented by (evidence: `hybrid-credit-scoring-vietnam/src/models/logistic_model.py`)
- Model interface → Random forest: implemented by (evidence: `hybrid-credit-scoring-vietnam/src/models/random_forest_model.py`)
- Model interface → LightGBM: implemented by (evidence: `hybrid-credit-scoring-vietnam/src/models/lightgbm_model.py`)
- Feature selection → Hybrid XGBoost: provides selected features
- Hybrid XGBoost → Credit metrics: evaluated with metrics
- Logistic regression → Credit metrics: benchmarked with metrics
- Random forest → Credit metrics: benchmarked with metrics
- LightGBM → Credit metrics: benchmarked with metrics
- Hybrid XGBoost → Calibration: assessed for calibration
- Credit metrics → Model plots: visualizes evaluation
- Hybrid XGBoost → SHAP analysis: interpreted with SHAP
- Credit data → EDA plots: explored with plots
