How krishnavamsi-04/home-credit-default-risk-prediction works
This repository is a Home Credit loan-default risk modeling project, with a small inference script that scores one applicant using saved preprocessing state and an XGBoost model. The documented workflow moves from exploratory analysis and a baseline through model comparison, tuning, cross-validation, and SHAP explainability, then corrects preprocessing leakage and saves artifacts for inference. The README documents notebook capabilities, but their internal calls are not available here; those relationships are shown only where the README supports them. Phase 3 API and frontend are planned, not implemented.
Main entry points: phase1b_leakage_fix.ipynb Leakage correction · predict.py Feature preprocessing · phase2_modeling.ipynb Model comparisons · phase1_eda_baseline.ipynb EDA and baseline
Components 16
Analysis and baseline
- EDA and baseline
notebooks/phase1_eda_baseline.ipynb - Leakage correction
notebooks/phase1b_leakage_fix.ipynb
Modeling and explainability
- Model comparisons
notebooks/phase2_modeling.ipynb - Tuning and validation
notebooks/phase2_modeling.ipynb - SHAP explanations
notebooks/phase2_modeling.ipynb
Saved inference artifacts
- Imputation medians
artifacts/medians.pkl - Frequency maps
artifacts/freq_maps.pkl - Training columns
artifacts/train_columns.pkl - Preprocessing config
artifacts/config.pkl - XGBoost model
artifacts/xgb_model.json
Applicant scoring
- Score CLI
predict.py - Feature preprocessing
predict.py - Risk scoring
predict.py
Other components
- Home Credit data
- Applicant
- Risk score
Connections 21
- Home Credit data → EDA and baseline: analyzed in
README.md - Home Credit data → Model comparisons: used for modeling
README.md - Home Credit data → Leakage correction: read by
README.md - EDA and baseline → Model comparisons: followed by
README.md - Model comparisons → Tuning and validation: tunes models
README.md - Model comparisons → SHAP explanations: explains model
README.md - Leakage correction → Imputation medians: saves
README.md - Leakage correction → Frequency maps: saves
README.md - Leakage correction → Training columns: saves
README.md - Leakage correction → Preprocessing config: saves
README.md - Leakage correction → XGBoost model: saves
README.md - Applicant → Score CLI: provides input
predict.py - Score CLI → Feature preprocessing: calls
predict.py - Feature preprocessing → Imputation medians: loads
predict.py - Feature preprocessing → Frequency maps: loads
predict.py - Feature preprocessing → Training columns: aligns features
predict.py - Feature preprocessing → Preprocessing config: uses settings
predict.py - Score CLI → Risk scoring: calls
predict.py - Risk scoring → Feature preprocessing: prepares features
predict.py - Risk scoring → XGBoost model: scores with
predict.py - Risk scoring → Risk score: returns score
predict.py