Docsity

Stroke Prediction final report for thesis, Schemes and Mind Maps of Computer Communication Systems

Toggle sidebar
bg1
An Efficient Method for Stroke Prediction based on
Machine Learning
By
Md. Abide Hassan Nayon
Student ID: 20182007010
Priyanka Roy
Student ID: 20182022010
Nahiduz Zaman
Student ID: 20182029010
Department of Computer Science and Engineering
Faculty of Science & Technology
North Western University, Khulna-9100
Bangladesh
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49

Partial preview of the text

Download Stroke Prediction final report for thesis and more Schemes and Mind Maps Computer Communication Systems in PDF only on Docsity!

An Efficient Method for Stroke Prediction based on

Machine Learning

By

Md. Abide Hassan Nayon

Student ID: 2018 2007010

Priyanka Roy

Student ID: 2018 2022010

Nahiduz Zaman

Student ID: 2018 2029010

Department of Computer Science and Engineering

Faculty of Science & Technology

North Western University, Khulna- 9100

Bangladesh

ii NORTH WESTERN UNIVERSITY, KHULNA DEPARMENT OF COMPUTER SCIENCE AND ENGINEERING September 2022 The undersigned hereby certify that Md. Abide Hassan Nayon , Priyanka Roy and Nahiduz Zaman of the Department of Computer Science and Engineering, North Western University, Bangladesh have successfully completed the thesis entitled An Efficient Method for Stroke Prediction based on Machine Learning in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science and Engineering (CSE) at North Western University, Bangladesh.

1. Research Supervisor Soniya Yeasmin Senior Lecturer Department of Computer Science and Engineering North Western University, Khulna 2. Second Examiner Md. Shymon Islam Lecturer Department of Computer Science and Engineering North Western University, Khulna 3. Head of the Department Tajul Islam Assistant Professor Department of Computer Science and Engineering North Western University, Khulna

iv Acknowledgement First of all, we would like to thank Almighty Allah for giving us enough mental and physical strength to complete our thesis properly. We would like to express our sincere gratitude to our supervisor Soniya Yeasmin for her cooperation, suggestion, guidance, and continuous encouragement through the course of the study. We are highly grateful to our second examiner Md. Shymon Islam, for reviewing this report and giving us suggestions to improve it. Besides our supervisor, we would like to acknowledge our honorable teachers of the Department of Computer Science and Engineering, North Western University, Bangladesh, for their encouraging support and discussion. We also thank our parents for their encouragement, support, and attention. We are also thankful to our classmates for their moral support which helped us to accomplish our thesis.

v Dedication Both our parents give enough inspiration and encouragement to complete our thesis work. And our teachers also give tips to do the whole task. So, we dedicate this book to our parents and our family and our honorable teachers.

vii 2.6.4 Multinomial Naive Bayes .................................................................... 22 2.6.5 Bernoulli Naive Bayes ......................................................................... 23 2.6.6 Support vector machine ....................................................................... 25 2.6.7 Adaboost .............................................................................................. 26 2.6.8 Decision Tree ....................................................................................... 27 2.6.9 Logistic Regression ............................................................................. 29 2.6.10 XGBoost .............................................................................................. 30 2.6.11 CART................................................................................................... 30 2.6.12 C4.5 31 2.7 Introduction to Python ...................................................................................... 31 2.8 Summary .......................................................................................................... 32 3 Related Works 33 3.1 Introduction ...................................................................................................... 33 3.2 Stroke Risk Prediction with Machine Learning Techniques ............................ 33 3.3 A predictive analytics approach for stroke prediction using machine learning and neural network …………………………………………………………………... 34 3.4 EFFICIENT PREDICTION OF STROKE PATIENTS USING LOGIS- TIC REGRESSION ALGORITHM IN COMPARISON TO DECISION TREE ALGORITHM ....................................................................................... 35 3.5 Automated Prediction of Brain Stroke Disease Classification Using Ma- chine Learning Algorithm Techniques ............................................................. 36 3.6 Brain Stroke Prediction Portal Using Machine Learning ................................. 36 3.7 Stroke prediction analysis using machine learning classifiers and feature technique .......................................................................................................... 37 3.8 A Survey on Stroke Disease Classification and Prediction using Machine Learning Algorithms ........................................................................................ 38 3.9 Stroke Disease Detection and Prediction Using Robust Learning Approaches 38 3.10 Stroke Prediction Using Machine Learning Algorithms .................................. 39 3.11 Predicting Risk of Stroke From Lab Tests Using Machine Learning Algorithms: Development and Evaluation of Prediction Models..................... 40 3.12 Analyzing the Performance of Stroke Prediction using ML Classification Algorithms ........................................................................................................ 41 3.13 Stroke prediction through Data Science and Machine Learning Algorithms 42 3.14 Heart Stroke Prediction using Machine Learning ............................................ 42 3.15 Prediction of Stroke Using Machine Learning ................................................. 43 3.16 Prediction of Brain Stroke Severity Using Machine Learning ......................... 44 3.17 Data mining model and application for stroke prediction: A combination of demographic and medical screening data approach ..................................... 45 3.18 Summary .......................................................................................................... 45 4 Methodology………………………………………………………………………... 47 4.1 Introduction ...................................................................................................... 47 4.2 Dataset .............................................................................................................. 48 4.3 Data Preprocessing ........................................................................................... 48 4.4 Missing value.................................................................................................... 48

viii

x Lists of Table 5.1 Dataset…………………………………………………………………………... 49 5.2 Results of different ML algorithms applying the Hold-Out Method…………… 52 5.3 Results of different ML algorithms applying 10-fold cross-validation…………. 57 5.4 Comparison of Ml Model act……………………………………………………. 62

1

Chapter I

Background

1.1 Introduction: Stroke, also known as brain attack, happens when blood flow to the brain is blocked, pre- venting it from getting oxygen and nutrients from it and causing the death of brain cells within minutes. A stroke is a medical emergency that requires urgent medical attention. World Health Organization (WHO) estimates that fifteen million people worldwide suffer from strokes each year, with one person dying every four to five minutes in the affected population. Strokes are classified as ischemic or hemorrhagic. In a chemical stroke, clots obstruct the drainage; in a hemorrhagic stroke, a weak blood vessel bursts and bleeds into the brain. Stroke may be avoided by leading a healthy and balanced lifestyle that includes abstaining from unhealthy behaviors, such as smoking and drinking, keeping a healthy body mass index (BMI) and an average glucose level, and maintaining an excellent heart and kidney function. The most common medical error occurs due to expiry of medicines, incorrect drugs, incorrect dosages and treatment given to the wrong patient. According to the Centers for Disease Control and Prevention (CDC), stroke is the fifth- leading cause of death in the United States. It is the fourth significant reason for death in India. It is the third leading cause of death in Bangladesh. A dataset is chosen from kaggle with various physiological traits as its attributes to proceed with this task. These traits are later analyzed and used for the final prediction. The dataset is initially cleaned and made ready for the machine learning model to understand. This step is called Data Preprocessing. For this, the dataset is checked for null values and fill them. Then Label encoding is performed to convert string values into integers followed by one-hot encoding, if necessary. After Data Preprocessing, the dataset is split into train and test data. A model is then built using this new data using various Classification Algorithms. Accuracy is calculated for all these algorithms and compared to get the best-trained model for prediction. After training the model and calculating the accuracy, web page and a Flask application are developed. The web application is for the user to enter the values for prediction. The flask application is a framework that connects the trained model and the web application. After proper analysis, the paper concludes which algorithm is most appropriate for the prediction of stroke. 1.2 Application Areas: Some of the application areas of discussed problem (Stroke Prediction) are given here to understand the necessity of solving it in present time.  Artificial Intelligence (AI) is a growing sub-field of computer science that aims to mimic cognitive processes through a number of techniques.  Superficial AI, which is comprised of techniques that learn patterns with the use of labels of ‘ground truth’ data, have become a significant area of interest within the medical community. As images are, in essence, volumes of mineable data, radiology is a field of medicine particularly well suited to supervised AI techniques.

3 Accuracy score was the only metric used for calculating the performance that might not always give favorable results. We have used different data mining classification techniques to predict the possibility of a stroke. The dataset was taken from kaggle. The classification algorithms used were Multi layers perceptron (MLP). With these algorithms, the model obtained an accuracy of around 97.68%. The time taken for training and predicting is higher we have used a combination of complex algorithms. After training the model and calculating the accuracy and web page and a Flask application are developed. The web application is for the user to enter the values for prediction. The flask application is a framework that connects the trained model and the web application. After proper analysis, the paper concludes which algorithm is most appropriate for the prediction of stroke. 1.5 Objectives: Overall, the objectives of the thesis can be summarized as follows:  To examine the factors that influence acute and total length of stay (LOS) for stroke patients.  Activities of daily living (ADL) is crucial for post-stroke patients.  No robust prediction models are currently available.  A machine learning-based approach to predict ADL is proposed based on the assessments from rehabilitation ward of a reference hospital.  ADL of post-stroke patients could be accurately predicted by the approach. 1 .6 Thesis Organization: The remainder of the thesis is organized as the following: Chapter 2 (Background Knowledge): Represent an overview of background knowledge and techniques. Also, gave the description of machine learning, feature selection and classification that we have to know. Chapter 3 (Related Works): Discuss different proposed idea in machine learning and also best machine learning model that proposed in before. Related research work given to help our thesis. Chapter 4 (Proposed Methodology): In this chapter we discussed our methodology and show the working model of our work including feature selection and classification.

4 Chapter 5 (Experimental Results and Analysis): For verification our dataset we implement the dataset: Wisconsin Original Dataset. In this section we present the implementation and result of our proposed work. Chapter 6 (Conclusion and Future Works): In this section we conclude the thesis and discussion our future work. 1.7 Summary: In this chapter we only describe about what stroke prediction is. On the next chapter we’ll discuss about the background knowledge of stroke prediction using machine learning and it’s some of techniques. By showing graph, data we want to describe how much people are suffering from stroke and how to detect are you at risk of having stroke.

6  Hypertension  Heart Disease  Ever Married  Work type  Residence  Average Glucose Level  BMI  Smoking Status  Stroke 2.4.1 Dataset Visualization The 5 columns of our dataset is below- Figure 2.1: Stroke Prediction DatasetHere we can see the first five columns of our used data. 2.4.2 Stroke Count Figure 2.2: Stroke Count We can see the numbers of stroke count in our dataset before preprocessing and tuning. Here only 2 types of result we can get that is ’YES’ or ’NO’. 0 means Yes and 1 means No.

7 2.4.3 Gender Count The graph shows us the numbers of gender in our dataset. There are three types of genderin our dataset. About 2000+ male genders and about 2800+ female genders and also someothers genders. Figure 2.3: Gender Count 2.4.4 Stroke Rate in Gender Figure 2.4: Stroke Rate In above picture we can see the stroke rate in gender. Where we can clearly say that malegender has more risk from female gender to attack in stroke. 2.4.5 Age vs Hypertension Figure 2.5: Age vs Hypertension

9 2.4.8 Smoking Status Figure 2.8: Smoking Status The chart shows us the smoking status of the peoples in our dataset that contains four categories which are smokes, never smokes, formerly smokes, unknown. The never smokesand unknown chart is significant. 2.4.9 Smoking vs Heart Disease The smokes and formerly smokes person has more risk to attack heart disease which wegot from the below picture. Figure 2.9: Smoke vs Heart Disease

10 2.4.10 BMI vs Heart Disease and Stroke Figure 2.10: BMI vs Heart Disease BMI is also important for a human body. It also causes heart disease and stroke too. Figure 2.11: BMI vs Stroke This picture tells that high BMI is also causes stroke for human body. 2.4.11 Type vs Stroke Figure 2.12: Work Type Vs Stroke