How raj-raaz/credit-risk-prediction-api works
This repository serves credit-default predictions through a FastAPI endpoint and a Flask-rendered web page. The API validates applicant fields, builds a tabular input, and invokes a serialized scikit-learn/XGBoost model to return a class and default probability. The README also documents the notebook-based training workflow. The template and notebook contents were not sampled, so their internal behavior and detailed wiring are not represented.
Main entry points: main.py Prediction handler · Credit_risk_prediction.joblib Serialized model · Credit Risk.ipynb Training and EDA · index.html Prediction form
Components 13
User interfaces
- Web UI
app/main.py - Prediction form
app/templates/index.html - FastAPI app
app/main.py
Prediction runtime
- Input validation
app/schemas.py - Prediction handler
app/main.py - Applicant frame
app/main.py - Risk model
app/main.py - Serialized model
Credit_risk_prediction.joblib - Prediction response
app/main.py
Model training
- Training and EDA
Credit Risk.ipynb
Other components
- Applicant
- API client
- Credit risk dataset
Connections 12
- Applicant → Web UI: enters details
- Web UI → Prediction form: renders
- API client → FastAPI app: sends request
- FastAPI app → Input validation: validates input
- FastAPI app → Prediction handler: dispatches
- Prediction handler → Applicant frame: builds frame
- Prediction handler → Risk model: predicts
- Serialized model → Risk model: loads
- Risk model → Prediction handler: returns scores
- Prediction handler → Prediction response: returns response
- Credit risk dataset → Training and EDA: trains on
- Training and EDA → Serialized model: serializes model