File size: 1,562 Bytes
8b0cce7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ---
tags:
- tabular-classification
- xgboost
- scikit-learn
- loan-default
---
# Loan Default Classifier
Binary classifier predicting whether a loan applicant will default, mirrored here from the
MLflow Model Registry of the source project (`loan-default-classifier`, best model: **xgboost**).
## Test set performance
| Model | Accuracy | Precision | Recall | F1 | ROC-AUC | PR-AUC |
|---|---|---|---|---|---|---|
| logistic_regression | 0.672 | 0.214 | 0.680 | 0.325 | 0.739 | 0.313 |
| random_forest | 0.856 | 0.358 | 0.309 | 0.332 | 0.740 | 0.310 |
| xgboost | 0.687 | 0.221 | 0.671 | 0.333 | 0.746 | 0.324 |
## Usage
`model.pkl` is a scikit-learn `Pipeline` (preprocessing + classifier) saved with `joblib`. It expects
a single-row DataFrame with these raw feature columns:
`Age, Income, LoanAmount, CreditScore, MonthsEmployed, NumCreditLines, InterestRate, LoanTerm, DTIRatio, Education, EmploymentType, MaritalStatus, HasMortgage, HasDependents, LoanPurpose, HasCoSigner`
```python
import joblib
import pandas as pd
pipeline = joblib.load("model.pkl")
row = pd.DataFrame([{...}], columns=['Age', 'Income', 'LoanAmount', 'CreditScore', 'MonthsEmployed', 'NumCreditLines', 'InterestRate', 'LoanTerm', 'DTIRatio', 'Education', 'EmploymentType', 'MaritalStatus', 'HasMortgage', 'HasDependents', 'LoanPurpose', 'HasCoSigner'])
probability = pipeline.predict_proba(row)[0, 1]
```
Trained as part of an end-to-end MLOps pipeline (DVC + MLflow + FastAPI + Docker + GitHub Actions).
Source repository: https://github.com/Yashwanth-R19/loan-default-mlops
|