A Survey on Heart Attack Prediction Using Machine Learning

Machine Learning Algorithm is used for many different diseases. Machine Learning is a learning of machine by own itself. And it is a part of AI that deals with to learn a machine according to their own. Now-a-days most are affected due to Heart attack it becomes head ache for doctors. In order to reduce the count of death we need to predict the Heart attack. For this problem Machine Learning play a major role in this paper. This prediction takes a people from the danger zone of their life. In this paper we use KNN algorithm and Random forest algorithm can predict the heart attack in advance.


Introduction
A big amount of complex data information in the healthcare Industry today about patients, medical devices, hospitals resources, and electronic patients records etc. Anyway large amount of data is useful for predict the data analysis and its used for minimize the cost [1]. As per WHO many heart Attack are come for people in abroad. In initial Stage The diseases is identifying correctly check in the vital time. It is really a head pain for the doctor's [5]. Many scientific technologies are adopting doctors now-a-days there are many technology machines are very useful for predicting many diseases [33]. Sometimes doctors may fail to take accurate decisions for heart attack prediction system which is use machine learning such as to get accurate results [6]. Important attributes like, age, gender, blood pressure, etc to predict the heart attack. Many heart strokes are happening because of accumulation of cholesterol in blood vessels or blood clot in blood vessels in arteries which supply blood to the heart muscles. External and internal image of heart figure 1 and figure 2 are given below.

. Machine Learning Algorithms
In this paper we our focus is how we can train the Machine to learn from the medical data so it can predict and treat the disease [43]. Through Experience process of acquiring knowledge in called learning. From the minute of boring we have to start the process of getting knowledge [50]. The process of Learning will come out through our experience Machine Learning is the process of Learning and training the machine by own itself [21]. Machine Learning has some statistics, Human psychology and brain modelling [12]. Neural models are used for understanding the human brain [9]. ML algorithms need a dataset, which is collection of records are instances where each instance consist of attributes [20].
The classifications of Machine Learning are Supervised Learning and Unsupervised Learning. The supervised Learning usually work with labelled data to learn mapping function that's turn input into output variable. The unsupervised Learning models work with the input data and not the output data for any given sample unlabelled data is used to model the data.
Algorithms with their accuracies are: • Random Forest; 86.89% with 200, 500 & 1000 estimators • K-Nearest Neighbours; 91.8% with 8 neighbours 3. KNN Algorithm KNN means K Nearest Neighbours and it is very easy algorithm that give more practice can keep available data and give a new data [10]. The neighbour points is similar to the sample that added to the new point. KNN algorithm is used to website for searching similarities items. [31].The number of nearest is to be predict that needed in the algorithm if KNN algorithm of the K neighbours of the new point.KNN algorithm are otherwise defined as lazy learner because the ability of the model learning is pretty fast. It will learn through the practice and it will memorize the data very well.
This clustering algorithm, is one of the simplest and also a popular unsupervised algorithm. In other words, the K-means algorithm denotes k number of centroids, and then assigns every data point to the nearest cluster, while keeping the centroids as tiny as possible in the result. This K-means algorithm is mostly used for the classification process [36]. First we need to select the value of K to predict the algorithm [37]. Based to figure 1,When the point is in the blue color that define as class y, points in in the green color define as class x, points is in yellow color defines as class z. When the k value is equal to neighbour points that represent triangle [18]. Based on the figure 1 when k=8 new points is near to on yellow point, four blue point, and three green point. We have to major of blue point, In this case, we can say that for k=8 is a new points is that belongs to class y.

How does the Algorithm Work
If the k points is near to 16 we have to take different 16 points that near to closest point. We can test the several values of K with the technique of cress-validation in order to find the excellent k value. To find the low distance between neighbour point [27], Use either Euclidean distance otherwise Manhattan distance. In the Manhattan Distance will calculate the real vectors and the sum of their difference. Workflow of KNN algorithm describes in figure 3.

Data Collection
We can get the dataset from the Kaggale.com to predict the heart attack [2]. There are three classification of data's they are factual information's. And data in the dataset can be divided into two types categorical data and number of data. The attributes of dataset are given below table no 1.

Random Forest Algorithm
Random forest algorithm is a supervised machine learning algorithm, which is helpful for both classification and regression problems. Similarly, with the help of the data samples, random forest algorithm creates the decision trees. With the samples from those decision trees the best solution will be predicted [36].
Random forest algorithm is more flexible and also easy to use algorithm that produces result without hyperparameter tuning, which produces the greatest of all time. It is also one of the most used algorithms, because of its simplicity [6]. Random Forest algorithm can be considered to be one among bagging techniques and not boosting techniques. The random forests trees usually run in parallel. The trees in boosting algorithms will be trained sequentially [36].

React Framework
Compostable user interfaces is build by React library and it encourage creation of reusable UI components in which current data that changes over time. React is used as V in MVC and it abstracts away the DOM from you, offering a easier programming model and better performance [4]. It can also render on the server using Node, and powers native apps using React Native React is easier about traditional data binding and it is reduces the boiler plate.

Flask Framework
The web application framework is Know as Flask and it is written in Python. This is founded by Armin Ronacher; he is leads to python enthusiasts named Pocco. Flask is an refers to micro framework. It does not have built-in function for database handling. It is supports the extensions to add function to the application. The difference between the existing system and proposed system are given below table no 2, 3. Since the IOT devices are used it is not portable.
3. It is portable because the data are being stored in the server. 4.In the existing system only some of the parameters are being checked. 4. In the proposed system all the parameters will be checked so that it is more efficient.
5. The maintenance cost will be high because of the some hardware devices.

5.
Here the maintenance cost is low when compared.

Case Study
Scope of this research is to predict whether a patient is affected by heart disease or not. This survey was done on supervised machine learning classification techniques using Random forest, and KNN algorithm. The Source Data for training the model are bootstrapped to generate a random large number of trees. Evaluation of predictor variables is done by how often they make successful predictions or how much they decrease node impurity when they are selected for the splits [36].

Conclusion
The major concern for the society is Heart Disease .It is hard to determine manually the odds of getting heart diseases based on risk factors like age etc. The useful technology used to predict the output from data is Machine Learning technology. In this survey, we have designed a system which is suited for real-time heart disease prediction and can be used by the users who have coronary disease [47]. The diagnosis system of the system is able to predict the heart disease by using ML algorithms and the prediction results are based on the heart disease dataset instance [44]. For checking the variances and raising the alarm if the user's heart rate rises than the normal rate of the heart. To prove the effectiveness of the system we have carried out experiments for both monitoring and diagnosis systems [50].