| --- |
| 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 |
|
|