Watch Demo Video
Machine Learning
Stroke Risk Prediction Using Machine Learning
The Stroke Risk Prediction Using Machine Learning system is a comprehensive machine learning solution that predicts stroke risk using demographic, medical history, and lifestyle factors. This project is ideal for B.Tech, MCA, CSE, and engineering students as their final year project. It uses advanced algorithms like Random Forest and Logistic Regression with SMOTE to achieve 94.8% accuracy.
The system leverages features including age, gender, hypertension, heart disease, BMI, glucose level, smoking status, and engineered risk scores. It provides interactive visualizations, feature importance analysis, model comparison, and real-time stroke risk prediction to help healthcare providers identify high-risk patients early for preventive care.
Python 3.8+
Machine Learning
Random Forest
Logistic Regression
SMOTE
Scikit-learn
imbalanced-learn
Pandas
NumPy
Matplotlib
Seaborn
Flask
HTML/CSS/JS
Key Features:
- Binary Stroke Risk Prediction
- Random Forest (94.8% Accuracy)
- Logistic Regression (92.1% Accuracy)
- SMOTE for Class Imbalance
- Feature Importance Analysis
- Real-time Risk Prediction
- Model Performance Comparison
- Interactive Visualizations
- 5-Fold Stratified CV
- Flask Web Application
Algorithms Used
🌲 Random Forest Classifier
Ensemble learning with 300 trees, captures non-linear relationships effectively
🎯 Accuracy: 94.8%
📊 Logistic Regression
Statistical model with L2 regularization, interpretable coefficients
🎯 Accuracy: 92.1%
🔧 Feature Engineering
Age risk, glucose risk, BMI risk, combined risk index
📊 Features: 15+
🔍 5-Fold Leak-Free CV
Cross-validation with SMOTE inside each fold
📊 RF: 93.4% ± 1.8%
Methodology & Workflow
1
Data Loading & Inspection
Healthcare dataset with 5,110 patient records
2
Data Preprocessing
Cleaning, encoding, missing value imputation, feature scaling
3
Feature Engineering
Age risk, glucose risk, BMI risk, combined risk index
4
Model Training
Random Forest & Logistic Regression with SMOTE pipelines
5
Model Evaluation
Accuracy, Precision, Recall, F1-Score, ROC-AUC, 5-fold CV
6
Web Deployment
Flask web app for real-time stroke risk prediction
Model Performance Comparison
| Metric |
Random Forest |
Logistic Regression |
Best |
| Accuracy |
0.948 |
0.921 |
Random Forest |
| Precision |
0.942 |
0.915 |
Random Forest |
| Recall |
0.948 |
0.921 |
Random Forest |
| F1-Score |
0.927 |
0.893 |
Random Forest |
| ROC-AUC |
0.937 |
0.895 |
Random Forest |
| CV Mean (5-Fold) |
0.934 |
0.891 |
Random Forest |
Project Package Includes:
Complete Source Code
Documentation (50+ pages)
Video Tutorial
Dataset (5,110 records)
Flask Web App
Model Files (Pickle)
Visualizations
24/7 Expert Support