How javvajivarun/credit-risk-prediction works
This is a single-script credit-risk analysis pipeline for predicting loan defaults while optimizing expected loss and measuring age-group fairness. The principal workflow loads or generates data, preprocesses it, trains a reweighted random forest, selects a loss-sensitive threshold, calibrates thresholds by age group, and visualizes results. The graph preserves these documented stages and major capabilities. Source excerpts confirm several implementation details, but omit parts of the script; stage-to-stage links therefore rely on the README rather than claims about unseen calls.
Main entry points: complete_pipeline.py Default probabilities
Components 14
Data preparation
- Pipeline runner
complete_pipeline.py - Credit dataset
- Data loading
complete_pipeline.py - Preprocessing
complete_pipeline.py - Train-test split
complete_pipeline.py
Risk modeling
- Sample reweighting
complete_pipeline.py - Random forest
complete_pipeline.py - Default probabilities
complete_pipeline.py
Decision and fairness
- Expected-loss sweep
complete_pipeline.py - Age-group analysis
complete_pipeline.py - Group thresholds
complete_pipeline.py
Results
- Visualization
complete_pipeline.py - Metrics and results
complete_pipeline.py
Other components
- Analyst
Connections 15
- Analyst → Pipeline runner: runs
README.md - Credit dataset → Data loading: provides data
README.md - Pipeline runner → Data loading: starts
README.md - Data loading → Preprocessing: then preprocesses
README.md - Preprocessing → Train-test split: then splits
README.md - Train-test split → Sample reweighting: then reweights
README.md - Sample reweighting → Random forest: trains
README.md - Random forest → Default probabilities: estimates risk
README.md - Default probabilities → Expected-loss sweep: sweeps thresholds
README.md - Default probabilities → Age-group analysis: measures fairness
README.md - Expected-loss sweep → Group thresholds: informs calibration
README.md - Age-group analysis → Group thresholds: guides fairness fix
README.md - Expected-loss sweep → Visualization: plots losses
README.md - Group thresholds → Visualization: plots fairness
README.md - Visualization → Metrics and results: presents results
README.md