How nanyoullm/simple-model-monitor works
This Flask application monitors distributions for multiple credit scores and their features across reporting periods. Users view the latest period by default, then select scores and periods to compare model and feature distributions; the browser receives chart-ready data for rendering. The backend queries MySQL and formats results through shared utilities. Fake-data generation populates the same tables for demonstration. The templates and static tree establish the dashboard UI, while excerpts do not expose its exact Ajax or chart wiring; those links are therefore omitted.
Main entry points: model_monitor.py Flask app · utils.py Query utilities · save_fake_data.py Fake data generator · index.html Dashboard page
Components 15
Web application
- Flask app
model_monitor.py - LAN server
server.py
Distribution data
- MySQL
- Model statistics
init.sql - Feature statistics
init.sql - Query utilities
utils.py - Chart formatting
utils.py - Fake data generator
save_fake_data.py - Synthetic distributions
utils.py
Dashboard UI
- Dashboard page
templates/index.html - Test page
templates/test.html - Browser charts
static/js/china.js - Score and period selectors
static/js/bootstrap-select.js - Dashboard styles
static/css/bootstrap.css
Other components
- Analyst
Connections 15
- Analyst → Flask app: requests dashboard
- LAN server → Flask app: hosts app
- Flask app → Query utilities: requests data
- Query utilities → MySQL: queries
- MySQL → Model statistics: reads
- MySQL → Feature statistics: reads
- Query utilities → Chart formatting: formats results
- Flask app → Dashboard page: renders page
- Flask app → Browser charts: returns chart data
- Analyst → Score and period selectors: selects comparisons
- Fake data generator → Synthetic distributions: generates
- Fake data generator → MySQL: writes data
- MySQL → Model statistics: stores
- MySQL → Feature statistics: stores
- Dashboard page → Dashboard styles: uses styles