Back to selected work
CASE STUDY / Machine learning

Credit Risk Prediction & Decision Pipeline

A credit-default experiment on 30,000 client records, connecting feature engineering and ensemble models to an API and risk dashboard. Evaluation focuses on the trade-offs of an imbalanced dataset.

CONTRIBUTION

Project work · CV and public repository

PROJECT STATUS

Public project · see repository for latest activity

EXPLOREView source on GitHub
PyTorchXGBoostOptunaMLflowFastAPIStreamlit
03 / MODELING & SERVING+
Simplified system architecture
THE SYSTEM, AT A GLANCE

From a model score to an inspectable pipeline.

  • Heterogeneous four-model ensemble
  • Focal loss for class imbalance
  • Experiment tracking through serving
01 / CONTEXT

The problem and its constraints.

The project predicts next-month credit-card default using a 30K-record dataset. It connects a modeling experiment to preprocessing, API serving, experiment tracking, and a dashboard. The reported results describe this experiment, not real-world lending outcomes.

  • The CV reports a 78/22 class imbalance.
  • Default recall and precision need to be considered together.
  • Training and serving need consistent preprocessing.
02 / CONTRIBUTION

What the evidence supports.

The CV describes Shaswot's feature engineering, four-model ensemble, focal-loss experiments, threshold calibration, and serving pipeline. The public repository provides the project implementation and documentation.

03 / ENGINEERING DECISIONS

Inside the approach.

01

Engineer a smaller feature set

The CV reports reducing 24 raw attributes to 10 selected features and deriving cumulative delinquency features. The goal was to keep high-signal information available to the downstream models.

02

Compare complementary models

XGBoost, Random Forest, and PyTorch MLP models form a heterogeneous four-model ensemble with probability averaging. Focal loss and Optuna optimization address the imbalanced classification setup.

03

Connect calibration and serving

Five-fold out-of-fold threshold calibration sits alongside MLflow experiment tracking. FastAPI and Pydantic support prediction serving, with preprocessing, model routing, and a Streamlit/Plotly dashboard.

04 / EVALUATION & RELIABILITY

Results with context.

0.35 → 0.630

Default recall

CV-reported comparison on the project's 30K-record credit dataset.

0.781

AUC-ROC

CV-reported evaluation on the credit-default experiment.

Typed request validation and real-time feature preprocessing define the serving boundary. MLflow records experiments so model and evaluation changes can be tracked. Metrics shown here retain the CV's dataset context.

05 / ENGINEERING TAKEAWAY

What this project demonstrates.

A useful ML project connects data preparation, model comparison, calibration, and serving instead of stopping at a single score.

A POSSIBLE NEXT STEP

Calibration plots and subgroup error analysis would make the evaluation easier to inspect. These are proposed extensions, not verified existing features.

Explore the evidence.

Project repository Résumé and reported results
NEXT CASE STUDY

Kathmandu Rain Prediction