Views
No views yet
⚠️ Research / education only — not a real lending decision system. Trained on 1987–2014 SBA loans; the conformal risk control holds in distribution and degrades under temporal shift.
serving_bundle.joblib — ServingBundle (pipeline + temperature + conformal thresholds + form schema).sba_xgb.onnx — the gradient-boosted model exported to ONNX (preprocessing kept in the serving layer).The deployed app uses a per-loan rule (approve if individual risk ≤ α, reject if ≥ 50%, else refer). The project also studies conformal marginal risk control and adaptive conformal under shift — see the GitHub repo.
1from huggingface_hub import hf_hub_download
2import joblib, pandas as pd
3
4bundle = joblib.load(hf_hub_download("animeshakr/sba-credit-trust", "serving_bundle.joblib"))
5X = pd.DataFrame([{ # one loan, approval-time features only
6 "Term": 84, "NoEmp": 5, "CreateJob": 0, "RetainedJob": 0, "GrAppv": 150000,
7 "SBA_Appv": 100000, "ApprovalFY": 2005, "sba_portion": 100000/150000, "real_estate": 0,
8 "State": "CA", "BankState": "CA", "NewExist": "1", "UrbanRural": "1",
9 "RevLineCr": "N", "LowDoc": "N", "naics_sector": "44", "is_franchise": 0,
10}])[bundle.numeric_cols + bundle.categorical_cols]
11
12p = bundle.predict_proba(X)[0] # calibrated P(default)
13decision = bundle.decide([p], alpha=0.05)[0] # auto-approve / auto-reject / abstain (refer)
14print(p, decision)mirbektoktogaraev/should-this-loan-be-approved-or-denied). A prior public
demo on this dataset over-reports due to oversampling-before-split leakage; this model corrects that.