Pieter182 commited on
Commit
ee519a0
·
verified ·
1 Parent(s): 38aafad

Upload MzansiScore model artifacts

Browse files
Files changed (1) hide show
  1. README.md +106 -0
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: tabular-classification
3
+ library_name: scikit-learn
4
+ tags:
5
+ - credit-risk
6
+ - south-africa
7
+ - xgboost
8
+ - lightgbm
9
+ - tabular-classification
10
+ - fastapi
11
+ - synthetic-data
12
+ model-index:
13
+ - name: Pieter182/mzansiscore-credit-risk
14
+ results:
15
+ - task:
16
+ type: tabular-classification
17
+ name: Credit default risk prediction
18
+ dataset:
19
+ name: Synthetic South African credit applications
20
+ type: tabular
21
+ metrics:
22
+ - type: roc_auc
23
+ value: 0.9243
24
+ - type: gini
25
+ value: 0.8486
26
+ - type: brier_score
27
+ value: 0.0883
28
+ ---
29
+
30
+ # MzansiScore Credit Risk Model
31
+
32
+ MzansiScore is a synthetic South African credit risk model pack for probability-of-default scoring, affordability-aware decisioning, and explainable API deployment.
33
+
34
+ ## Repository contents
35
+
36
+ This repository is expected to contain:
37
+
38
+ - `best_tree_model.joblib` — best-performing tree model selected during training
39
+ - `logistic_regression.joblib` — interpretable regulatory baseline
40
+ - `feature_cols.joblib` — ordered feature columns used by the tree model
41
+ - `label_encoders.joblib` — fitted encoders for categorical features
42
+ - `model_meta.json` — metrics, governance metadata, fairness summaries, and rationale catalog
43
+ - `README.md` — this model card
44
+
45
+ ## Model summary
46
+
47
+ - Primary selected model artifact: **XGBoost**
48
+ - Published scoring artifact summary: **XGBoost_cal**
49
+ - Holdout AUC: **0.9243**
50
+ - Holdout Gini: **0.8486**
51
+ - Holdout Brier score: **0.0883**
52
+ - Training rows: **133108**
53
+ - Holdout rows: **33278**
54
+ - Train default rate: **23.46%**
55
+ - Holdout default rate: **23.46%**
56
+ - Positive-class weighting: **3.26**
57
+
58
+ ## Regulatory and governance context
59
+
60
+ - Geography: **South Africa**
61
+ - Training data: **synthetic** loan application and affordability data
62
+ - Policy overlay: **nca_affordability_pass**
63
+ - Policy description: Applicants failing affordability are declined outside the model.
64
+ - Proxy score features are excluded from regulated training by default
65
+ - Fairness summaries are recorded in `model_meta.json`
66
+ - Adverse-action rationale templates are recorded in `model_meta.json`
67
+
68
+ ## Top feature drivers
69
+
70
+ | Feature | Importance |
71
+ |---|---:|
72
+ | affordability_surplus | 0.7421 |
73
+ | combined_risk | 0.5698 |
74
+ | credit_score | 0.3508 |
75
+ | expense_understatement_flag | 0.3242 |
76
+ | worst_status_12m | 0.2179 |
77
+ | affordability_margin | 0.2073 |
78
+ | worst_status_3m | 0.1864 |
79
+ | debit_order_returns_3m | 0.1527 |
80
+ | affordability_surplus_ratio | 0.1526 |
81
+ | age | 0.1197 |
82
+
83
+ ## Intended use
84
+
85
+ Use this model pack for:
86
+
87
+ 1. Demo scoring APIs
88
+ 2. Explainable credit-risk dashboard prototypes
89
+ 3. Internal experimentation on calibrated probability-of-default workflows
90
+
91
+ ## Limitations
92
+
93
+ - The underlying data is synthetic and should not be treated as live production applicant data.
94
+ - This repository is not a substitute for formal model validation, governance approval, or legal review.
95
+ - Production credit decisions should include affordability, compliance, monitoring, and human oversight controls.
96
+
97
+ ## Example deployment flow
98
+
99
+ 1. Download artifacts from the HuggingFace model repository.
100
+ 2. Load `best_tree_model.joblib`, `feature_cols.joblib`, and `label_encoders.joblib`.
101
+ 3. Rebuild engineered features before inference.
102
+ 4. Apply policy rules alongside predicted default probability.
103
+
104
+ ## Training notes
105
+
106
+ The current training pipeline compares Logistic Regression, XGBoost, calibrated XGBoost, LightGBM, and calibrated LightGBM. Calibration is included because credit decisioning depends on reliable probability-of-default estimates, not only rank ordering.