How hussainbasha559/bank-personal-loan-predictor works
The system offers two prediction interfaces: a Streamlit app and a FastAPI endpoint. In the main user workflow, an applicant enters details in Streamlit; the agent gets a prediction and SHAP contributions, turns them into a decision, confidence, insights, and suggestions, and the app displays a waterfall explanation. The app also provides overview, dashboard, and dataset views backed by SQLite. The README describes broader training and dataset capabilities, but the sampled runtime source does not establish their implementation, so they are not mapped as runtime components.
Main entry points: streamlit.py Home Overview · agent.py Decision Agent · predictor.py Prediction and SHAP · api.py Prediction Endpoint
Components 14
Streamlit App
- Home Overview
app/streamlit.py - Dashboard
app/streamlit.py - Prediction Form
app/streamlit.py - Explanation View
app/streamlit.py - Dataset View
app/streamlit.py
Explainable Inference
- Decision Agent
src/agent.py - Prediction and SHAP
src/predictor.py - SHAP Explainer
src/predictor.py
Data and Models
- Loan Model
models/loan_model.pkl - Clean Loan Data
data/bank_loan.db - Feature Scaler
models/scaler.pkl
Prediction API
- Prediction Endpoint
app/api.py
Other components
- Applicant
- API Client
Connections 15
- Applicant → Home Overview: opens app
README.md - Applicant → Prediction Form: enters details
README.md - Prediction Form → Decision Agent: submits profile
app/streamlit.py - Decision Agent → Prediction and SHAP: requests prediction
src/agent.py - Prediction and SHAP → Loan Model: predicts with
src/predictor.py - Prediction and SHAP → SHAP Explainer: calculates contributions
src/predictor.py - Decision Agent → Explanation View: returns decision and insights
app/streamlit.py - Explanation View → SHAP Explainer: renders waterfall
app/streamlit.py - Home Overview → Dashboard: navigates to
app/streamlit.py - Home Overview → Dataset View: navigates to
app/streamlit.py - Dashboard → Clean Loan Data: reads dataset
app/streamlit.py - Dataset View → Clean Loan Data: displays dataset
app/streamlit.py - API Client → Prediction Endpoint: posts customer data
app/api.py - Prediction Endpoint → Loan Model: predicts with
app/api.py - Prediction Endpoint → Feature Scaler: scales features
app/api.py