How singusathwik/credit-card-risk-prediction works
This repository trains a credit-card default model and presents predictions through a web application backed by a Flask API. The main user flow is customer-profile entry, API prediction, and risk-result display, with accuracy shown separately. Training covers dataset loading, feature engineering, model selection, and saved metrics/features. Training details beyond the excerpts are represented from the README; frontend-to-API and server behavior are supported by the sampled source.
Main entry points: App.jsx Application state and requests · server.py Flask prediction API · train_model.py Model training and selection · RiskForm.jsx Customer profile form
Components 13
Model training
- Credit default data
default of credit card clients.xls - Feature engineering
train_model.py - Model training and selection
train_model.py - Feature columns
feature_columns.json - Accuracy metrics
model_accuracy.json
Prediction API
- Flask prediction API
server.py
Risk interface
- Application state and requests
src/App.jsx - Customer profile form
src/components/RiskForm.jsx - Risk results
src/components/RiskResults.jsx - Accuracy panel
src/components/StatsPanel.jsx - Application header
src/components/Header.jsx - React entry point
src/main.jsx
Other components
- Business user
Connections 14
- Credit default data → Feature engineering: provides data
README.md - Feature engineering → Model training and selection: builds features
README.md - Model training and selection → Feature columns: saves columns
README.md - Model training and selection → Accuracy metrics: saves metrics
README.md - Business user → Customer profile form: enters profile
src/components/RiskForm.jsx - Customer profile form → Application state and requests: submits data
src/App.jsx - Application state and requests → Flask prediction API: requests prediction
src/App.jsx - Flask prediction API → Feature columns: reads columns
server.py - Flask prediction API → Accuracy metrics: reads metrics
server.py - Flask prediction API → Application state and requests: returns prediction
src/App.jsx - Application state and requests → Risk results: passes prediction
src/App.jsx - Application state and requests → Accuracy panel: passes accuracy
src/App.jsx - React entry point → Application state and requests: mounts
src/main.jsx - Application state and requests → Application header: renders
src/App.jsx