Banking¶
A retail-banking and credit-risk warehouse. Customers open accounts, apply for loans, transact, and are monitored for default. Credit score band is tracked with SCD2 versioning; loan applications produce child document records; accounts hold multiple products via an M:N bridge. Disbursements get CDC audit. Student-t noise reflects heavy-tailed transaction amounts. A holdout split reserves the last quarter for credit-scoring validation.
What it produces¶
| Table | Type | Grain | Rows (default) | Notes |
|---|---|---|---|---|
dim_date |
dim | per_period | 24 | 24 monthly periods, Jan 2023 – Dec 2024 |
dim_customer |
dim | per_entity (+ SCD2 + geo) | 100–400 | 98 customers, expanded by SCD2 credit-score band moves |
dim_product |
dim | per_reference | 8 | checking, savings, credit_card, ..., heloc |
dim_merchant_category |
dim | per_reference | 10 | grocery, fuel, dining, ..., cash_advance |
fct_account_activity |
fact | per_entity_per_period | 2,352 | seven metrics + loan officer narrative column |
fct_loan_applications |
fact | variable (proportional, CDC) | ~loan_vol | one row per application; CDC for amendments |
fct_loan_documents |
fact | per_parent_row | 1–3× parent | child docs per application |
evt_transaction |
event | variable (proportional) | ~12,000 | scaled 5× transaction_volume |
evt_default |
event | variable (threshold) | 5–25 | default_risk above 0.65 for 2 consecutive periods |
bridge_customer_product |
bridge | static M:N | 100–490 | each customer holds 1–5 products |
<fct>_train, <fct>_holdout |
fact | holdout split | — | one pair per per_entity_per_period fact (3-period split) |
98 entities across six segments: prime_borrower (22),
subprime_improving (18), mass_market (24), deteriorating (12),
hnw (8), new_customer (14, half in a treatment cohort).
Features exercised¶
- Heavy-tailed noise —
noise_family: student_t,degrees_of_freedom: 4.0. Transaction-amount outliers reflect real retail-banking tail risk. - Seasonality — Holiday spend Q4 (+0.30), tax-refund surge Mar–Apr (+0.20), summer slowdown Jun–Jul (-0.10).
- Causal lag —
delinquency_riskfollowscredit_utilizationwith delay 2 periods. - SCD2 —
credit_score_bandondim_customertrackingdefault_riskwith thresholds[0.25, 0.55, 0.80]. - Parent / child facts —
fct_loan_applications(variable-grain, driven byloan_volume) →fct_loan_documents(per_parent_row, 1–3 docs per application). - CDC —
fct_loan_applicationscarries audit columns for disbursement amendments. - Bridge —
bridge_customer_product(M:N), trajectory-driven byaccount_balanceso high-balance customers hold more products. - Geo bundle —
branch_country,branch_country_code,branch_region,branch_cityondim_customer. - Narrative column —
loan_officer_notesonfct_account_activity, with per-segment lexicons (uses YAML anchors to share a base block across segments). - A/B treatment —
new_customersegment 50/50 split: half get a credit-line increase at period 6, half don't. - Holdout — last three months reserved for credit-scoring
validation; emits
_trainand_holdoutfile pairs per per_entity_per_period fact. - Lifecycle stages —
performing/watch/past_due/defaultondefault_risk.
Quality injection is omitted to keep the credit-scoring teaching
surface clean. holdout and quality combine cleanly if you want to
layer corruption on top — corrupted rows are sliced by date_key, so
both train and holdout splits carry their share of issues.
Use it¶
Common customizations¶
Shorten the holdout window¶
Reserve one month instead of three:
Swap student-t for gaussian noise¶
Heavier-tailed transactions are realistic but produce extreme outliers that some downstream pipelines reject. To use plain gaussian:
Increase the loan-document fan-out¶
Default is 1–3 documents per application. Bump to 2–8:
Where it shines¶
- Credit-scoring training pipelines —
default_riskas target,fct_account_activityjoined todim_customerfor features, the holdout split for validation. - Fraud/AML rule tuning —
evt_transactionjoined todim_merchant_categoryproduces transaction streams with realistic amount distributions (heavy-tailed) and seasonal patterns. - M:N entity-resolution exercises —
bridge_customer_productgives a many-to-many surface to practice bridge-resolution SQL.