How nischal2211/cvd_risk_prediction_system works
This Flask application lets users create accounts, enter 12 health parameters, and receive a probability-based cardiovascular risk level, risk factors, and advice; signed-in users can review prior assessments. An admin view summarizes users and prediction trends. Model training is a separate workflow that reads the supplied dataset and produces artifacts loaded by the web app. The sampled code supports the main assessment, account, history, and part of the admin data flow; unsampled route details are represented only where README or tree evidence supports them.
Main entry points: app.py Flask application · model_training.py Model training · database.db SQLite database · cvd_model.pkl Random Forest model
Components 17
Web application
- Flask application
app.py - Account management
app.py - Risk assessment
app.py - Risk scoring and advice
app.py - History and profile
app.py - Admin analytics
app.py
Application data
- SQLite database
database.db
Model lifecycle
- Model training
model_training.py - Model evaluation
model_evaluation.py - Training dataset
cardio_train.csv - Random Forest model
cvd_model.pkl - Feature scaler
scaler.pkl - Feature list
features.pkl
User interface
- HTML views
templates - Stylesheet
static/css/style.css
Other components
- User
- Administrator
Connections 24
- User → Flask application: uses
- Administrator → Flask application: uses
- Flask application → Account management: dispatches
- Flask application → Risk assessment: dispatches
- Flask application → History and profile: dispatches
- Flask application → Admin analytics: dispatches
- Account management → SQLite database: reads and writes
- History and profile → SQLite database: reads and writes
- Admin analytics → SQLite database: queries
- Risk assessment → Feature scaler: transforms with
- Risk assessment → Random Forest model: predicts with
- Risk assessment → Feature list: uses
- Risk assessment → Risk scoring and advice: derives risk details
- Risk assessment → SQLite database: stores prediction
- Flask application → Random Forest model: loads
- Flask application → Feature scaler: loads
- Flask application → Feature list: loads
- Flask application → HTML views: renders
- HTML views → Stylesheet: uses
- Model training → Training dataset: reads
- Model training → Random Forest model: writes
- Model training → Feature scaler: writes
- Model training → Feature list: writes
- Model evaluation → Training dataset: evaluates models on