The Heart Stroke Prediction System is a machine learning-based application developed to predict the risk of heart stroke using patient health information. The system helps users identify potential stroke risks at an early stage through intelligent data analysis. It considers important health parameters such as age, gender, hypertension, heart disease, BMI, smoking status, glucose level, and work type. The collected data is preprocessed and analyzed to improve prediction accuracy. A Logistic Regression algorithm is used to classify whether a person is likely to experience a stroke or not. The model is trained using historical healthcare data and evaluated with testing datasets. The application is developed using Python and Flask to provide a simple and user-friendly web interface. Users can enter their health details and receive instant prediction results. The system also includes a BMI calculator and basic health guidance to improve awareness. It supports early diagnosis and encourages preventive healthcare measures. The proposed system reduces manual assessment time and provides quick decision support. It offers an efficient, accurate, and cost-effective solution for heart stroke risk prediction. Overall, this project demonstrates how machine learning can assist healthcare professionals and individuals in improving early stroke detection and promoting better health management.
Introduction
The Heart Stroke Prediction System is a machine learning-based application developed to predict the likelihood of stroke using patient health information. Stroke is a leading cause of death and disability, and early risk detection can improve treatment outcomes and reduce complications. Unlike traditional diagnosis methods that rely on manual analysis and medical expertise, the proposed system provides fast, accurate, and user-friendly predictions through artificial intelligence.
The system analyzes key health parameters, including age, gender, hypertension, heart disease, BMI, average glucose level, smoking status, work type, and residence type. Before model training, the healthcare dataset undergoes data preprocessing, where missing values and duplicate records are removed, categorical data is encoded into numerical values, and feature scaling is performed to improve model performance. The processed data is divided into training and testing datasets for evaluation.
The prediction model uses the Logistic Regression algorithm, a supervised machine learning technique suitable for binary classification. It learns relationships between patient health attributes and stroke occurrence from historical medical data and classifies users as either High Stroke Risk or Low Stroke Risk. The model is evaluated using standard performance metrics such as accuracy, precision, recall, and F1-score, and is regularly retrained with updated data to maintain reliability.
The application is implemented using Python and the Flask framework, with a web interface developed using HTML, CSS, and Bootstrap. Users can easily enter their health information and receive instant stroke risk predictions. The system also includes a BMI calculator to promote health awareness and encourage preventive healthcare.
Compared with existing systems, the proposed model addresses several limitations, including dependence on manual diagnosis, higher costs, longer processing times, lower prediction accuracy, inability to handle missing data effectively, limited accessibility, and lack of real-time decision support. It also improves usability through an interactive web interface and supports remote access.
Conclusion
The Heart Stroke Prediction System is an effective machine learning application developed to predict the risk of stroke using patient health information. The system analyzes important medical parameters such as age, hypertension, heart disease, BMI, glucose level, and smoking status to provide accurate predictions. By using the Logistic Regression algorithm, the application delivers reliable and efficient stroke risk classification. The proposed system reduces the time and effort required for manual medical assessment. It provides a simple and user-friendly web interface developed using Python and Flask. The application supports early diagnosis by providing instant prediction results based on user input. It also includes a BMI calculator to promote health awareness and preventive care. The system helps healthcare professionals make informed decisions with better accuracy. It minimizes human errors and improves the efficiency of disease prediction. The model can be updated with new healthcare data to maintain high prediction performance. The proposed solution is cost-effective, secure, and easily accessible for users. It demonstrates the practical application of artificial intelligence in the healthcare sector.
References
[1] Hosmer, D. W., Lemeshow, S., & Sturdivant, R. X. (2013). Applied Logistic Regression (3rd Edition). John Wiley & Sons, Hoboken, New Jersey, USA. ISBN: 978-0470582473.
[2] Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., et al. (2011). \"Scikit-learn: Machine Learning in Python.\" Journal of Machine Learning Research (JMLR), Vol. 12, pp. 2825–2830. Available: https://scikit-learn.org/
[3] Grinberg, M. (2018). Flask Web Development: Developing Web Applications with Python (2nd Edition). O\'Reilly Media, Sebastopol, California, USA. ISBN: 978-1491991732.
[4] McKinney, W. (2022). Python for Data Analysis: Data Wrangling with Pandas, NumPy, and Jupyter (3rd Edition). O\'Reilly Media. ISBN: 978-1098104030.
[5] Harris, C. R., Millman, K. J., van der Walt, S. J., et al. (2020). \"Array Programming with NumPy.\" Nature, Vol. 585, No. 7825, pp. 357–362. DOI: https://doi.org/10.1038/s41586-020-2649-2
[6] Hunter, J. D. (2007). \"Matplotlib: A 2D Graphics Environment.\" Computing in Science & Engineering, IEEE Computer Society, Vol. 9, No. 3, pp. 90–95. DOI: 10.1109/MCSE.2007.55.
[7] World Health Organization (WHO). Stroke: Key Facts and Global Health Statistics. World Health Organization, Geneva, Switzerland. Available: https://www.who.int/news-room/fact-sheets/detail/stroke
[8] Centers for Disease Control and Prevention (CDC). About Stroke and Stroke Prevention. U.S. Department of Health & Human Services. Available: https://www.cdc.gov/stroke/
[9] Kaggle. Stroke Prediction Dataset by Fedesoriano. Kaggle Inc. Available: https://www.kaggle.com/datasets/fedesoriano/stroke-prediction-dataset
[10] Python Software Foundation. Python 3 Official Documentation. Python Software Foundation. Available: https://docs.python.org/3/
[11] Pallets Project. Flask Official Documentation. Available: https://flask.palletsprojects.com/en/latest/
[12] Scikit-learn Developers. Scikit-learn User Guide and API Reference. Available: https://scikit-learn.org/stable/user_guide.html
[13] The Pandas Development Team. Pandas: Python Data Analysis Library Documentation. Available: https://pandas.pydata.org/docs/
[14] NumPy Developers. NumPy Official Documentation. Available: https://numpy.org/doc/stable/
[15] Bootstrap Team. Bootstrap 5 Documentation: Build Responsive Web Applications. Available: https://getbootstrap.com/docs/5.3/
[16] W3Schools. HTML, CSS, JavaScript, and Bootstrap Web Development Tutorials. Refsnes Data AS, Norway. Available: https://www.w3schools.com/