Datasets:
Card: recipe for building model A/B training mixes as in the paper; link metrics Space
Browse files
README.md
CHANGED
|
@@ -55,6 +55,7 @@ Data for the paper **"Mitigating Model Drift in Developing Economies Using Synth
|
|
| 55 |
- **Preprint (arXiv):** https://arxiv.org/abs/2510.09294
|
| 56 |
- **Code:** https://github.com/zypl-ai/stabilization_uplift (version `v1.0`)
|
| 57 |
- **Metrics package (PyPI):** [`pip install stabilization-uplift`](https://pypi.org/project/stabilization-uplift/)
|
|
|
|
| 58 |
|
| 59 |
The dataset supports the study of model drift in credit scoring: models are trained on a stable period, evaluated before and after a macroeconomic shock, and compared with and without synthetic training data containing different proportions of synthetic outliers. Stability is measured with the Stabilization Score (SS) and Stabilization Uplift (SU) metrics introduced in the paper.
|
| 60 |
|
|
@@ -122,6 +123,37 @@ The SS and SU metrics are available as a Python package, [`stabilization-uplift`
|
|
| 122 |
pip install "stabilization-uplift[shift]"
|
| 123 |
```
|
| 124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
## Sources and License
|
| 126 |
|
| 127 |
- **Lending Club data.** The `lending_club` and `lending_club_full_train` configurations are derived from the [Lending Club dataset on Kaggle](https://www.kaggle.com/datasets/wordsforthewise/lending-club), released there under [CC0: Public Domain](https://creativecommons.org/publicdomain/zero/1.0/). These files remain subject to the original dataset's license and terms of use.
|
|
|
|
| 55 |
- **Preprint (arXiv):** https://arxiv.org/abs/2510.09294
|
| 56 |
- **Code:** https://github.com/zypl-ai/stabilization_uplift (version `v1.0`)
|
| 57 |
- **Metrics package (PyPI):** [`pip install stabilization-uplift`](https://pypi.org/project/stabilization-uplift/)
|
| 58 |
+
- **Metrics calculator and `evaluate` module:** [zyplai/stabilization-uplift Space](https://huggingface.co/spaces/zyplai/stabilization-uplift)
|
| 59 |
|
| 60 |
The dataset supports the study of model drift in credit scoring: models are trained on a stable period, evaluated before and after a macroeconomic shock, and compared with and without synthetic training data containing different proportions of synthetic outliers. Stability is measured with the Stabilization Score (SS) and Stabilization Uplift (SU) metrics introduced in the paper.
|
| 61 |
|
|
|
|
| 123 |
pip install "stabilization-uplift[shift]"
|
| 124 |
```
|
| 125 |
|
| 126 |
+
### Building the training data of models A and B as in the paper
|
| 127 |
+
|
| 128 |
+
The mixes of real and synthetic data used to train model B are not stored separately: they are built from the `lending_club` and `synthetic` configurations. This reproduces the notebooks (CatBoost and other models; for TabPFN keep `issue_d`, and the notebook with LightGBM, NGBoost, TabNet, HGBoosting, XGBoost and FT-Transformer uses `N_SAMPLES = 8000`):
|
| 129 |
+
|
| 130 |
+
```python
|
| 131 |
+
import pandas as pd
|
| 132 |
+
|
| 133 |
+
REPO = "hf://datasets/zyplai/stabilization-uplift@v1.0"
|
| 134 |
+
N_SAMPLES, RANDOM_STATE = 4000, 100
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def sample(data):
|
| 138 |
+
return data.sample(n=N_SAMPLES, random_state=RANDOM_STATE)
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
columns = pd.read_parquet(f"{REPO}/synthetic/no_outliers.parquet").drop(columns="issue_d").columns
|
| 142 |
+
train, base_test, shock_test = (
|
| 143 |
+
sample(pd.read_parquet(f"{REPO}/lending_club/{split}.parquet")[columns])
|
| 144 |
+
for split in ("train", "base_test", "shock_test")
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
# Model A is trained on `train`. Model B is trained on a mix of `train` with one synthetic split:
|
| 148 |
+
mixes = {}
|
| 149 |
+
for split in ["no_outliers", "outliers_0_01", "outliers_0_03", "outliers_0_05",
|
| 150 |
+
"outliers_0_07", "outliers_0_1", "outliers_0_5", "outliers_1_0"]:
|
| 151 |
+
synthetic = sample(pd.read_parquet(f"{REPO}/synthetic/{split}.parquet")[columns])
|
| 152 |
+
mixes[split] = pd.concat([synthetic, train]).reset_index(drop=True).drop_duplicates()
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
Both models are then evaluated on `base_test` and `shock_test`, and compared with the Stabilization Score and Stabilization Uplift.
|
| 156 |
+
|
| 157 |
## Sources and License
|
| 158 |
|
| 159 |
- **Lending Club data.** The `lending_club` and `lending_club_full_train` configurations are derived from the [Lending Club dataset on Kaggle](https://www.kaggle.com/datasets/wordsforthewise/lending-club), released there under [CC0: Public Domain](https://creativecommons.org/publicdomain/zero/1.0/). These files remain subject to the original dataset's license and terms of use.
|