- SCIKIT-LEARN
- CALIBRATION
- TABULAR
Credit Risk Model

Credit-default risk model with rigorous evaluation: a leakage-free pipeline, cross-validated model comparison, calibrated probabilities, a cost-based decision threshold and per-segment error analysis. Code at github.com/delcenjo/credit-risk.
Default prediction on the UCI Taiwan dataset: 30,000 credit-card clients with a 22% default rate. The goal was not to fit a classifier but to turn the model into a defensible lending decision: leakage-safe validation, honest metrics for an imbalanced target, calibrated probabilities and a threshold chosen by the cost of mistakes.
- Test ROC-AUC0.779
- PR-AUC0.562
- Dataset30,000 clients
Comparing models without cheating
Logistic regression: 0.728 ROC-AUC and 0.505 PR-AUC. Gradient boosting: 0.781 and 0.562. Candidates are ranked by PR-AUC, not accuracy, because with 22% positives accuracy lies. The winner is evaluated once on the held-out test set: 0.779 ROC-AUC.
The threshold is worth more than the algorithm
A false negative (lending to someone who defaults) does not cost the same as a false positive (rejecting someone who would have paid). The decision threshold is chosen by minimising the expected cost under that asymmetry, and it moves the operating result more than switching models.
Where the model fails
Per-segment error analysis closes the project: looking at which subgroups concentrate the mistakes says more about the data and the features than any global metric. It was the part where I learned the most, because the errors were almost never where I expected.
Next projects:

Credit Risk Platform
End-to-end MLOps platform for credit-default scoring: reproducible training with a versioned model registry, a FastAPI inference API with input validation, PSI drift monitoring and a Prometheus and Grafana observability stack, all containerised with CI. Code at github.com/delcenjo/credit-risk-platform.

Transformer from scratch
A GPT-style language model implemented from scratch in PyTorch: multi-head attention, causal masking and residual blocks written by hand, plus a byte-pair tokenizer and an ablation study. Code at github.com/delcenjo/transformer-from-scratch.