An end-to-end Machine Learning solution designed to identify high-risk stroke patients using clinical and lifestyle data. This project features an XGBoost pipeline and a real-time interactive dashboard.
*Interactive dashboard built for real-time risk assessment.*
- Predictive Engine: Optimized XGBoost Classifier utilizing hyperparameter tuning via
RandomizedSearchCV. - Imbalance Handling: Addressed heavy class imbalance using
scale_pos_weight, prioritizing Recall (57%) to minimize dangerous False Negatives in a medical context. - Data Integrity: Identified and removed 'Stroke Risk Score' to prevent data leakage, ensuring the model relies purely on objective markers (BMI, Glucose, Medical History).
- Deployment Pipeline: Integrated StandardScaler for feature normalization and Joblib for model serialisation.
- Interoperability: Exported model to ONNX format to support future Native Mobile app integration.
- Language: Python
- ML Libraries: Scikit-learn, XGBoost, Pandas, NumPy
- Deployment: Streamlit
- Serialization: Joblib, ONNX
- Clone the repository:
git clone [https://github.com/yourusername/stroke-prediction.git](https://github.com/yourusername/stroke-prediction.git)
- Install dependencies:
pip install streamlit pandas joblib xgboost scikit-learn
- Launch the dashboard:
streamlit run app.py
The primary objective of this system is to serve as a high-sensitivity screening tool. By prioritizing Recall over global accuracy, the model is optimized to minimize False Negatives, ensuring that potential high-risk cases are flagged for clinical consultation. This approach shifts the focus from simple classification to a risk-mitigation strategy suitable for medical contexts.
