/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
pytorch
Опубликована
17 окт 2026

KaoLEAF

Классификация таблицTable → label3 профессии

KaoLEAF классифицирует кредитный риск по табличным данным заявки и выдаёт калиброванный балл, категорию риска и объясняющие коды причин.

0скачиваний за 30 дней0лайковвеса обновлены17 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

KaoLEAF — модель классификации табличных данных для оценки кредитного риска по заявке на кредит. Её разработал Теерапонг Панбуньюэн из лаборатории искусственного интеллекта Government Savings Bank (GSBAIL). Репозиторий содержит ансамбль из пяти обученных моделей и воспроизводимую реализацию на PyTorch; доступны веса и предобработчик для входных данных о заявителе.

Модель преобразует 24 финансовых признака в упорядоченные по смыслу токены, использует обучаемые периодические эмбеддинги, свёрточные блоки и многоголовое self-attention. Она выдаёт калиброванный балл от 300 до 850, одну из пяти категорий риска A–E и аддитивные коды причин, помогающие объяснить результат. Обучение и оценка описаны для датасета одобрения кредитов в США и Канаде; README сообщает о конкурентном качестве на этом наборе, но преимущество над настроенными градиентными бустингами не заявляется.

Это исследовательский артефакт, а не проверенная система кредитования. Данные, по описанию автора, вероятно синтетические или симулированные; оценка проведена на одном наборе и одном разбиении. Выпущенные веса используют защищённый признак возраста, а некоторые ценовые признаки могут приводить к утечке. Автор прямо запрещает применять эти веса для принятия или поддержки реальных кредитных решений. Лицензия — Apache-2.0.

Сценарии применения

  • оценка риска одобрения заявки на кредит
  • ранжирование заявок по вероятности одобрения
  • разбиение заявителей на категории риска A–E
  • получение объясняющих кодов причин для оценки заявки
  • исследовательское сравнение моделей кредитного скоринга

Ограничения

Модель оценена на одном наборе данных, который автор считает вероятно синтетическим или симулированным; перенос результатов на реальные банковские данные не подтверждён. Выпущенные веса включают защищённый признак возраста, а README запрещает использовать их для реальных кредитных решений.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

🍃 KaoLEAF

An attention-based credit-decision model that explains itself. Calibrated 300–850 score · five A–E risk bands · additive reason codes a credit officer can read.

Demo Dataset Project page GitHub

AUC ECE Params PyTorch License Status

Teerapong Panboonyuen · Government Savings Bank Artificial Intelligence Laboratory (GSBAIL)

Status. The manuscript is in preparation, so numbers and wording may change before publication. This repository releases the trained weights and a reproducible reference implementation. It is a research artifact, not a lending system.


✨ Why KaoLEAF

Most tabular credit models give you a number. KaoLEAF gives you a number you can defend.

🧭 Knowledge-ordered tokens24 engineered features become tokens arranged by financial meaning: profile → credit behaviour → capacity → request.
🔢 Learned periodic embeddingsNumeric features get a learned periodic embedding instead of a raw scalar.
🧩 Gated depthwise-separable conv + multi-head self-attentionLocal mixing inside a financial block, global interactions across blocks.
🪜 Two-stage learningSelf-supervised masked-feature modelling, then supervised fine-tuning, repeated over a 5-seed deep ensemble.
🎯 Calibrated by designTemperature scaling on validation (T = 1.044), a 300–850 score, five monotone bands.
🔍 AuditableIntegrated Gradients with a completeness check, attention rollout, a SHAP cross-check, ICE/PDP monotonicity tests, slice/fairness audit.
🧱 LayeredRepresentation, outcome prediction and decision policy are separate, so thresholds and hard rules change without retraining.
 applicant record (18 raw fields → 24 engineered features)
        │
        ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ Feature tokeniser   periodic embedding (numeric, k=8, σ=0.5)│
 │                     learned embedding (categorical)         │
 │ Knowledge order     Profile → Credit behaviour → Capacity → │
 │                     Request                                 │
 │ Local operator      gated depthwise-separable 1-D conv (k=3)│
 │ Global operator     3 × multi-head self-attention (d=64, h=4)│
 │ Behaviour embedding z  ──►  logistic head                   │
 └─────────────────────────────────────────────────────────────┘
        │  × 5 seeds, mean logit ÷ T (temperature scaling)
        ▼
 P(approve)  ──►  KaoLEAF Score = round(300 + 550·p)  ──►  Band A–E  ──►  Reason codes (IG)

📊 Results

Benchmark: Loan Approval (US & Canada), 50,000 applicants, stratified 70/10/20 split (seed 42), 10,000 held-out test applicants. Every model receives the same features, and the tree baselines were tuned and early-stopped on the same validation set.

ModelTest AUCPR-AUCKSECE ↓Brier ↓
KaoLEAF-Fusion (KaoLEAF + GBDT stack)0.98520.98810.86170.00960.0484
LightGBM (Optuna)0.98500.98790.86070.01080.0487
CatBoost0.98490.98790.86070.01290.0489
XGBoost0.98420.98740.85810.01370.0501
HistGradientBoosting0.98350.98660.85330.01110.0511
⭐ KaoLEAF (5-seed ensemble, calibrated) — the weights in this repo0.98250.98580.84780.01070.0529
FT-Transformer (plain)0.97980.98370.84390.01080.0564
MLP (embeddings)0.97440.97940.81990.01060.0638
Random Forest0.97370.97890.82160.05610.0683
Extra Trees0.96670.97400.79640.09530.0848
Logistic Regression0.94270.95110.72890.00800.0947

🧐 How to read this honestly

  • The weights in this repo are the standalone KaoLEAF ensemble (AUC 0.9825). The Fusion row stacks KaoLEAF with gradient-boosted trees; those tree models are not part of this release.
  • KaoLEAF-Fusion ranks first, but its margin over tuned LightGBM is small (+0.0002 AUC), and the 95% bootstrap intervals of the top models overlap.
  • The standalone ensemble is competitive but sits behind the tuned gradient-boosted trees. It beats the plain FT-Transformer (+0.0027 AUC), the MLP (+0.0081) and logistic regression (+0.0397).
  • In the single-seed ablation, only the periodic embedding shows a consistent gap. Other differences are inside seed noise.
  • The case for KaoLEAF is ranking that is competitive with boosting, plus a reusable embedding, calibrated scores, stable bands and faithful explanations. It is not a claim of beating boosting on AUC.

🎚️ Score bands (test set)

BandScore rangeApplicantsShareMean predictedObserved approval
A · Very strong740–8504,63246.3%97.5%97.8%
B · Strong631–7406096.1%70.4%71.1%
C · Moderate520–6304644.6%50.3%57.8%
D · Weak410–5205045.0%29.7%33.9%
E · Very weak300–4103,79137.9%2.3%2.7%

Observed approval rises monotonically from E to A and tracks the predicted rate in every band.


🚀 Quick start

pip install torch numpy pandas scikit-learn scipy joblib huggingface_hub
import sys
from huggingface_hub import snapshot_download

path = snapshot_download("kaopanboonyuen/KaoLEAF")   # weights + preprocessor + kaoleaf.py
sys.path.insert(0, path)
import kaoleaf as kl

scorer = kl.KaoLEAFScorer.load(path, device="cpu")

applicant = dict(
    age=29, occupation_status="Employed", years_employed=4.0, annual_income=52000,
    credit_score=655, credit_history_years=6.0, savings_assets=3500, current_debt=9000,
    defaults_on_file=0, delinquencies_last_2yrs=1, derogatory_marks=0,
    product_type="Personal Loan", loan_intent="Education", loan_amount=15000,
    interest_rate=15.5, debt_to_income_ratio=0.31, loan_to_income_ratio=0.29,
    payment_to_income_ratio=0.10,
)

res = scorer.predict(applicant)
print(res.p_approve[0], res.kaoleaf_score[0], res.risk_band[0])
# 0.9997  850  A - Very strong

why, _ = scorer.explain(applicant, top_k=4)       # Integrated Gradients reason codes
for feature, value, attribution in why[0]["reasons_against_approval"]:
    print(kl.format_reason(feature, value, attribution))

A runnable copy is in examples/quickstart.py. To try it without code, open the live demo.

Input schema

scorer.predict takes raw applicant fields; the 6 extra ratios are engineered inside kaoleaf.engineer.

FieldTypeNotes
ageintProtected attribute, see Limitations
occupation_statusstrEmployed · Self-Employed · Student
years_employed, credit_history_yearsfloatyears
annual_income, savings_assets, current_debt, loan_amountnumbercurrency units as in the dataset
credit_scoreint300–850
defaults_on_file, delinquencies_last_2yrs, derogatory_marksintcounts (defaults_on_file is 0/1)
product_typestrCredit Card · Personal Loan · Line of Credit
loan_intentstrBusiness · Debt Consolidation · Education · Home Improvement · Medical · Personal
interest_ratefloatpercent
debt_to_income_ratio, loan_to_income_ratio, payment_to_income_ratiofloatin the dataset these are current_debt/income, loan_amount/income and ≈ loan_to_income/3

Keep decisions as policy, not as model weights

def decision_policy(p, defaults_on_file, approve=0.60, review=0.40):
    if defaults_on_file == 1:
        return "DECLINE (policy rule: default on file)"
    return "APPROVE" if p >= approve else "MANUAL REVIEW" if p >= review else "DECLINE"

In the data, defaults_on_file = 1 is never approved (0 of 2,674 applicants), so it is enforced as a rule rather than learned.

🔐 Security note. kaoleaf_prep.joblib is a pickle-based file (a fitted scikit-learn preprocessor). Hugging Face will flag it as pickle. Load it only from sources you trust, such as this repository at a pinned revision.


🔍 Explainability and audit

  • Global importance from mean |Integrated Gradients|, per feature and per financial block.
  • Cross-check against LightGBM SHAP: Spearman ρ = 0.72 between two model families and two attribution methods.
  • Reason codes per applicant, in calibrated-logit units, in the structure of an adverse-action list.
  • Attention rollout is reported as a descriptive diagnostic, not a causal explanation. The faithful additive explanation is Integrated Gradients.
  • Monotonicity audit with ICE/PDP for credit score (↑), DTI (↓), delinquencies (↓) and credit history (↑).
  • Slice audit by age group, occupation, product and loan intent, with the adverse-impact ratio as a screening statistic, not a legal verdict.

📦 What is in this repository

FileWhat it is
kaoleaf_weights.pt5 ensemble members + temperature (≈3.9 MB)
kaoleaf_prep.joblibfitted preprocessor (quantile transform, category levels, median-applicant baseline)
kaoleaf_config.jsonarchitecture config, feature order, bands, dataset SHA-256, seed, stacker weights
kaoleaf.pymodel, preprocessing, training, explainability and the KaoLEAFScorer API
metrics.json, leaderboard.csvtest metrics for every model in the benchmark
test_predictions.csvscore, band and probability for each of the 10,000 test applicants
run_manifest.jsonlibrary versions, seed, GPU
figures/selected results, explainability and audit figures
examples/quickstart.pydownload-and-score example

Integrity. Weights SHA-256: d8086702aaaa871a35187e61e7a4a71f21f1e49bc642c430088753cfce5f2560. Dataset zip SHA-256: aa6435d06ea46ec256b79a2780faee807ba63334df4c4ce507aa9bc2097ae61f.

Training recipe. Stage 1: masked-feature modelling, 25 epochs. Stage 2: supervised fine-tuning, up to 60 epochs with early stopping. Seed 42, ensemble members use seed + s. Runs used Python 3.13, PyTorch 2.11 (CUDA 13.0) and a Colab T4. The model also runs on CPU. GPU kernels can still move AUC by about 1e-4, so report mean ± std over seeds.


⚠️ Limitations and governance

  • Cross-sectional data. One row per applicant. The local operator is a 1-D convolution over ordered financial features, not over time. Temporal modelling is not evaluated.
  • Likely simulated data. The public dataset appears synthetic or realistic-simulated, so results show method behaviour, not real bank performance.
  • Protected attribute. age is protected under US (ECOA) and Canadian lending rules. A variant trained without it is supported (DROP_FEATURES=["age"] in the notebook) and recommended for any deployment. The released weights include age.
  • Possible leakage. Pricing variables (interest_rate, payment_to_income_ratio) may be outputs of underwriting in production.
  • Single dataset, single split. Bootstrap intervals reflect test sampling only, not split variance.
  • Not validated for production lending. No GSB customer data is used.

Out-of-scope use. Do not use these weights to make or support real credit decisions about real people.


🗺️ Roadmap

  • Multi-seed, multi-split reporting for the paper
  • Monotonic-constraint variant for regulatory use
  • Knowledge distillation from gradient-boosted trees into KaoLEAF
  • Longer Stage-1 pre-training on larger unlabeled pools
  • Temporal encoder on longitudinal data (planned for GSB data, which cannot be public)

📝 Citation

The manuscript is in preparation. Until then, please cite the project:

@misc{panboonyuen2026kaoleaf,
  title  = {KaoLEAF: Knowledge-Augmented Optimization and Learned Embeddings
            for Automated Feature Representation},
  author = {Panboonyuen, Teerapong},
  year   = {2026},
  note   = {Government Savings Bank Artificial Intelligence Laboratory (GSBAIL).
            Manuscript in preparation.
            Code and project page: https://kaopanboonyuen.github.io/KaoLEAF}
}

🙏 Acknowledgements

All results were obtained on the Realistic Loan Approval Dataset | US & Canada by Parth Patel (parthpatel2130) on Kaggle. Please follow the license terms on the original Kaggle page. A split-preserving copy with full credit is at kaopanboonyuen/loan-approval-us-ca.

📄 License

The code and weights in this repository are released under the Apache-2.0 license. The training data is a third-party dataset under its own terms (see above).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · pytorch

Нельзя запустить

Табличные модели пока не поддерживаются.

Ревизия весов
3b8f4d0

0 моделей