How paragdhomne/loan-default-prediction works
Loan Default Prediction is a batch-trained binary-classification application with a FastAPI prediction service. Its documented workflow moves from raw data validation and preprocessing through leakage investigation, feature preparation, model comparison and threshold selection; the trained model and preprocessor then support online predictions. Reporting produces metrics and visualizations. The source excerpts confirm dataset processing, training, reporting, and API-to-prediction calls; README statements support the broader workflow. Data files are not present in the tree, so those stages point to their implementing source files.
Main entry points: train.py Train and tune models · dataset.py Validate and preprocess · predict.py Loan prediction · config.py Runtime configuration
Components 15
Data preparation
- Validate and preprocess
loan_default_prediction/dataset.py - Leakage investigation
references/leakage_analysis/check_clean_model.py - Feature preparation
loan_default_prediction/features.py
Model development
- Train and tune models
loan_default_prediction/train.py - Model comparison
loan_default_prediction/train.py - Threshold evaluation
loan_default_prediction/train.py - Metrics and visualizations
loan_default_prediction/reporting.py
Prediction service
- FastAPI endpoints
loan_default_prediction/api.py - Loan prediction
loan_default_prediction/predict.py
Configuration and outputs
- Model artifacts
models - Runtime configuration
loan_default_prediction/config.py
Other components
- Project operator
- Raw loan data
- Prediction caller
- Risk result
Connections 20
- Project operator → Validate and preprocess: runs processing
loan_default_prediction/dataset.py - Raw loan data → Validate and preprocess: loads CSV
loan_default_prediction/dataset.py - Validate and preprocess → Leakage investigation: investigates leakage
README.md - Leakage investigation → Feature preparation: informs selection
README.md - Feature preparation → Train and tune models: prepares features
README.md - Validate and preprocess → Train and tune models: uses processed data
loan_default_prediction/train.py - Train and tune models → Model comparison: compares models
loan_default_prediction/train.py - Train and tune models → Threshold evaluation: evaluates thresholds
loan_default_prediction/train.py - Metrics and visualizations → Train and tune models: calls training routines
loan_default_prediction/reporting.py - Metrics and visualizations → Threshold evaluation: reports threshold results
loan_default_prediction/reporting.py - Train and tune models → Model artifacts: saves models
loan_default_prediction/train.py - Prediction caller → FastAPI endpoints: submits loan
loan_default_prediction/api.py - FastAPI endpoints → Loan prediction: calls predictor
loan_default_prediction/api.py - Loan prediction → Model artifacts: loads model files
loan_default_prediction/predict.py - Loan prediction → Risk result: returns risk
loan_default_prediction/predict.py - FastAPI endpoints → Risk result: formats API result
loan_default_prediction/api.py - Validate and preprocess → Runtime configuration: uses configured paths
loan_default_prediction/dataset.py - Feature preparation → Runtime configuration: uses configured paths
loan_default_prediction/features.py - Train and tune models → Runtime configuration: uses training settings
loan_default_prediction/train.py - Loan prediction → Runtime configuration: uses decision threshold
loan_default_prediction/predict.py