← All Projects

Quantitative Finance · Machine Learning

Risk Analysis:
Lending Club

Cost-sensitive machine learning models predicting loan default probabilities using origination features — comparing logistic regression, XGBoost, and neural networks under asymmetric misclassification costs.

Python scikit-learn XGBoost TensorFlow Pandas Matplotlib
Full Report ↗
Lending Club Risk Analysis

3

Model Families

CS

Cost-Sensitive

AUC

Primary Metric

P2P

Lending Domain

01 / Problem

Loan default prediction under asymmetric costs

In P2P lending, false negatives (approving a loan that defaults) are far costlier than false positives (rejecting a good borrower). Standard accuracy-maximising models ignore this asymmetry. Lenders need models that can be tuned to explicitly weight the cost of default misclassification.

02 / Approach

Three model families with cost-sensitive learning

The dataset uses Lending Club origination features: loan grade, DTI ratio, FICO score, income, employment length, and purpose. After exploratory analysis and feature engineering, three model families are trained and compared: L2-regularised logistic regression (interpretable baseline), gradient-boosted trees via XGBoost, and a shallow neural network in TensorFlow.

All models are evaluated using AUC-ROC, precision-recall curves, and expected cost at varying classification thresholds. Class weights and sample weighting are applied to embed asymmetric misclassification costs directly into training — giving lenders a cost-threshold curve they can tune to their risk appetite.

03 / Result

Actionable risk curves across three model types

XGBoost outperforms logistic regression and the neural network on AUC while remaining interpretable via SHAP values. The cost-sensitive framework produces threshold-specific expected cost curves that translate directly into lending policy decisions. The full analysis — methodology, code, and results — is documented in the companion report.

Key Features
  • Logistic regression, XGBoost, and neural network comparison
  • Cost-sensitive training with asymmetric class weights
  • AUC-ROC, precision-recall, and expected-cost evaluation
  • SHAP feature importance for XGBoost interpretability
  • Threshold-tunable lending policy framework