SBA Credit-Trust β€” calibrated, selective loan-default model

Trustworthy default-risk model for U.S. SBA small-business loans (public dataset). The artefact is a self-contained serving bundle: an Optuna-tuned XGBoost classifier + temperature calibration + conformal approve/reject thresholds, so a single call yields a calibrated probability and a risk-controlled auto-approve / auto-reject / refer-to-human decision.

⚠️ 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.

Files

  • 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).

Held-out test performance

  • PR-AUC 0.924, ROC-AUC 0.982, isotonic ECE 0.001 (positive class = default, prevalence β‰ˆ 17.6%).
  • Per-loan decision at Ξ± = 0.05: auto-approve 71.5% at a realised 0.65% default rate among approved; auto-reject 17% (88% true defaults); refer 11.5%.

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.

Usage

from huggingface_hub import hf_hub_download
import joblib, pandas as pd

bundle = joblib.load(hf_hub_download("animeshakr/sba-credit-trust", "serving_bundle.joblib"))
X = pd.DataFrame([{  # one loan, approval-time features only
    "Term": 84, "NoEmp": 5, "CreateJob": 0, "RetainedJob": 0, "GrAppv": 150000,
    "SBA_Appv": 100000, "ApprovalFY": 2005, "sba_portion": 100000/150000, "real_estate": 0,
    "State": "CA", "BankState": "CA", "NewExist": "1", "UrbanRural": "1",
    "RevLineCr": "N", "LowDoc": "N", "naics_sector": "44", "is_franchise": 0,
}])[bundle.numeric_cols + bundle.categorical_cols]

p = bundle.predict_proba(X)[0]                 # calibrated P(default)
decision = bundle.decide([p], alpha=0.05)[0]   # auto-approve / auto-reject / abstain (refer)
print(p, decision)

Method & caveats

Full project (leakage-corrected benchmark, tabular DL, calibration, uncertainty, OOD, conformal, cost-sensitive policy, temporal-shift study, and adaptive conformal that restores risk control under shift), plus an honest audit (including a negative OOD result), are on GitHub: https://github.com/Animesh-Kr/sba-credit-trust

Demo Space: https://huggingface.co/spaces/animeshakr/sba-credit-trust

Reference dataset on Kaggle (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.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support