scieee AI-readable full text Open interactive document viewer

Data Mining Application for Healthcare Sector: Predictive Analysis of Heart Attacks

Fernandes, Maria Inês Resende da Lomba

Abstract

Cardiovascular diseases are the main cause of the number of deaths in the world, being the heart disease the most killing one affecting more than 75% of individuals living in countries of low and middle earnings. Considering all the consequences, firstly for the individual’s health, but also for the health system and the cost of healthcare (for instance, treatments and medication), specifically for cardiovascular diseases treatment, it has become extremely important the provision of quality services by making use of preventive medicine, whose focus is identifying the disease risk, and then, applying the right action in case of early signs. Therefore, by resorting to DM (Data Mining) and its techniques, there is the ability to uncover patterns and relationships amongst the objects in healthcare data, giving the potential to use it more efficiently, and to produce business intelligence and extract knowledge that will be crucial for future answers about possible diseases and treatments on patients. Nowadays, the concept of DM is already applied in medical information systems for clinical purposes such as diagnosis and treatments, that by making use of predictive models can diagnose some group of diseases, in this case, heart attacks. The focus of this project consists on applying machine learning techniques to develop a predictive model based on a real dataset, in order to detect through the analysis of patient’s data whether a person can have a heart attack or not. At the end, the best model is found by comparing the different algorithms used and assessing its results, and then, selecting the one with the best measures. The correct identification of early cardiovascular problems signs through the analysis of patient data can lead to the possible prevention of heart attacks, to the consequent reduction of complications and secondary effects that the disease may bring, and most importantly, to the decrease on the number of deaths in the future. Making use of Data Mining and analytics in healthcare will allow the analysis of high volumes of data, the development of new predictive models, and the understanding of the factors and variables that have the most influence and contribution for this disease, which people should pay attention. Hence, this practical approach is an example of how predictive analytics can have an important impact in the healthcare sector: through the collection of patient’s data, models learn from it so that in the future they can predict new unknown cases of heart attacks with better accuracies. In this way, it contributes to the creation of new models, to the tracking of patient’s health data, to the improvement of medical decisions, to efficient and faster responses, and to the wellbeing of the population that can be improved if diseases like this can be predicted and avoided. To conclude, this project aims to present and show how Data Mining techniques are applied in healthcare and medicine, and how they contribute for the better knowledge of cardiovascular diseases and for the support of important decisions that will influence the patient’s quality of life.

Full text

i Data Mining Application for Healthcare Sector Predictive Analysis of Heart Attacks Maria Inês Resende da Lomba Fernandes Project Work presented as partial requirement for obtaining the Master’s degree in Information Management with major in Knowledge Management and Business Intelligence 1 NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa Data Mining Application for Healthcare Sector Predictive Analysis of Heart Attacks by Maria Inês Fernandes Project Work presented as partial requirement for obtaining the Master’s degree in Information Management with a specialization in Knowledge Management and Business Intelligence Advisor: Rui Gonçalves December 2020 2 DEDICATION For my parents, of whom I am so proud, and who have always supported and motivated me. For uncle Carlos Lomba, aunt Maria José, and grandfather Serafim Lomba, in memoriam, who have always accompanied me and whom I miss so much. 3 ACKNOWLEDGEMENTS Developing this final master’s project revealed to be a challenging path marked by small and large steps, but mainly, it gave me the feeling of overcoming a goal that culminated on the accomplishment of another important chapter of my life, the master’s degree. Thereby, it is indispensable for me to give my deepest thanks and appreciation for all the people that gave me their unconditional support, namely, the guidance, motivation, patience, comprehension, positivity, and mental energy. Thank you for being there and for accompanying me on this journey, for the fantastic support, and for the strength that has always motivated me to keep going and that contributed for the achievement of this project. Nevertheless, I would also like to express some special gratitude: To my parents, who are an example for me and have always given me their support and motivation; To my family, who although distant, always follows me closely; To my advisor, Professor Rui Gonçalves, for his support, availability and guidance; To Daniel Almeida, for his incentive, comprehension and recommendations; To my friends Filipa Pedro, Mariana Nunes, Margarida Pereira, Joana Aço, and Inês Antunes for their support and for being strong pillars during this process. My sincere thanks to you all. 4 ABSTRACT Cardiovascular diseases are the main cause of the number of deaths in the world, being the heart disease the most killing one affecting more than 75% of individuals living in countries of low and middle earnings. Considering all the consequences, firstly for the individual’s health, but also for the health system and the cost of healthcare (for instance, treatments and medication), specifically for cardiovascular diseases treatment, it has become extremely important the provision of quality services by making use of preventive medicine, whose focus is identifying the disease risk, and then, applying the right action in case of early signs. Therefore, by resorting to DM (Data Mining) and its techniques, there is the ability to uncover patterns and relationships amongst the objects in healthcare data, giving the potential to use it more efficiently, and to produce business intelligence and extract knowledge that will be crucial for future answers about possible diseases and treatments on patients. Nowadays, the concept of DM is already applied in medical information systems for clinical purposes such as diagnosis and treatments, that by making use of predictive models can diagnose some group of diseases, in this case, heart attacks. The focus of this project consists on applying machine learning techniques to develop a predictive model based on a real dataset, in order to detect through the analysis of patient’s data whether a person can have a heart attack or not. At the end, the best model is found by comparing the different algorithms used and assessing its results, and then, selecting the one with the best measures. The correct identification of early cardiovascular problems signs through the analysis of patient data can lead to the possible prevention of heart attacks, to the consequent reduction of complications and secondary effects that the disease may bring, and most importantly, to the decrease on the number of deaths in the future. Making use of Data Mining and analytics in healthcare will allow the analysis of high volumes of data, the development of new predictive models, and the understanding of the factors and variables that have the most influence and contribution for this disease, which people should pay attention. Hence, this practical approach is an example of how predictive analytics can have an important impact in the healthcare sector: through the collection of patient’s data, models learn from it so that in the future they can predict new unknown cases of heart attacks with better accuracies. In this way, it contributes to the creation of new models, to the tracking of patient’s health data, to the improvement of medical decisions, to efficient and faster responses, and to the wellbeing of the population that can be improved if diseases like this can be predicted and avoided. 5 To conclude, this project aims to present and show how Data Mining techniques are applied in healthcare and medicine, and how they contribute for the better knowledge of cardiovascular diseases and for the support of important decisions that will influence the patient’s quality of life. KEYWORDS Cardiovascular Disease, Heart Attack, Data Mining, Machine Learning, Predictive Analysis, Neural Networks, Logistic Regression, Decision Trees 6 INDEX 1. Introduction ................................................................................................................ 11 1.1. Background and Problem Identification .............................................................. 11 1.2. Study Motivation and Relevance ......................................................................... 11 1.3. Study Objectives .................................................................................................. 14 1.4. Document Structure ............................................................................................. 15 2. LIterature Review ........................................................................................................ 16 2.1. Introduction to Data Mining and Machine Learning ........................................... 16 2.2. Algorithms for Predictive Modeling ..................................................................... 20 2.2.1. Artificial Neural Networks ............................................................................ 22 2.2.2. Decision Trees ............................................................................................... 29 2.2.2.1.Decision Trees Algorithms ................................................................ 30 2.2.3. Linear and Logistic Regression ..................................................................... 38 2.2.4. Ensemble Models .......................................................................................... 40 2.3. Data Mining Techniques applied to Heart Disease ............................................. 43 3. Research Methodology ............................................................................................... 48 3.1 Development of the model - Methodology Steps ................................................ 48 3.2 Dataset ................................................................................................................ 51 3.3 Data Analysis and Exploration ............................................................................. 51 3.4 Data Preprocessing .............................................................................................. 54 3.4.1 Outlier Detection and Removal .................................................................... 54 3.4.2 Missing Values .............................................................................................. 54 3.4.3 Coherence Checking...................................................................................... 54 3.4.4 Data Transformation .................................................................................... 55 3.4.5 Data Partition ............................................................................................... 56 3.5 Analysis of Variables ............................................................................................ 57 3.5.1 Variable Worth ............................................................................................. 57 3.5.2 Variable Selection Node ............................................................................... 58 3.5.3 Correlation Matrix Analysis .......................................................................... 60 3.6 Modeling .............................................................................................................. 61 3.6.1 Artificial Neural Network .............................................................................. 62 3.6.2 Regression .................................................................................................... 62 3.6.3 Decision Tree ................................................................................................ 63 3.6.4 Ensemble ...................................................................................................... 64 7 4 Assessment: Results and Discussion ........................................................................... 65 4.1 Model Comparison ....................................................................................... 65 4.2 Choice of the Best Model .............................................................................. 68 5 Conclusions ................................................................................................................. 70 6 Limitations and recommendations for Future Work .................................................. 73 7 Bibliography ................................................................................................................ 74 8 Appendix ....................................................................................................................... 1  Appendix 1: SAS Enterprise Miner Project Diagram ................................................ 1  Appendix 2: Treatment of Outliers ........................................................................... 1  Appendix 3: Correlation Matrix Results – Pearson Correlation ............................... 1  Appendix 4: Decision Tree Model ............................................................................. 1 8 LIST OF FIGURES Figure 1 - Deaths due to Coronary Heart Diseases in EU (Eurostat, 2020) ................................ 2 Figure 2 - Data Mining Flow (Aggarwal, 2015) .......................................................................... 7 Figure 3 - Confusion Matrix (Maheshwari, 2015) ...................................................................... 8 Figure 4 - Models and Algorithms used in Machine Learning (Source: Author Based) ............ 10 Figure 5 - General View of Modulation of the Prediction Process (Bação, 2019). ................... 11 Figure 6 - Single Layer Perceptron (Ujjwalkarn, 2016) ............................................................. 13 Figure 7 - Sigmoid Activation Function (Sharma, 2017) ........................................................... 14 Figure 8 - Hyperbolic tangent Activation Function (Sharma, 2017) ......................................... 14 Figure 9 - Rectified Linear Unit Activation Function (Sharma, 2017) ....................................... 15 Figure 10 - Multi-layer Perceptron (Patterson & Gibson , 2017) ............................................. 16 Figure 11 - Evolution of the Network based on Number of Neurons (Macukow, 2016) ......... 17 Figure 12 - Decision Tree Example (Kulkarni, 2017) ................................................................. 20 Figure 13 - Representation of the Entropy Relation (Nonchev, 2015)……………………………………23 Figure 14 - Root Node of Decision Tree (Sakkaf, 2020) ............................................................ 24 Figure 15 - Precision Level of a Decision Tree (Chavan, 2019) ................................................. 25 Figure 16 - Linear Regression Plotted (Patterson & Gibson, 2017) .......................................... 28 Figure 17 - Logistic Regression Function and Plot (Patterson & Gibson, 2017) ....................... 29 Figure 18 - Bagging and Boosting Examples (Garrido, 2016) .................................................. 31 Figure 19 - Creation of a Random Forest (Silipo & Melcher, 2019).......................................... 32 Figure 20 - Random Forest Classification Model (Navlani, 2018). ........................................... 32 Figure 21 - Methodology Steps for CRISP-DM (Chapman et al., 2000) .................................... 39 Figure 22 - Structure of SEMMA© Methodology (Source: Author Based) ............................... 40 Figure 23 - Summary Statistics for Class Targets (Source: SAS Miner Output, 2020) .............. 46 Figure 24 - Variable Worth (Source: SAS Miner Output, 2020) ................................................ 47 Figure 25 - Variable Selection Node Results (Source: SAS Miner Output, 2020)………………..…49 Figure 26 - Example of two Diagnostic Test: ROC Cures of Test A and Test B (Tilaki, 2013)…..55 Figure 27 - ROC Chart Model's Output (Source: SAS Miner Output, 2020)……….………………..…..56 15 - Classify people that may develop a heart attack and build a predictive model about it; - Identify the variables that most influence the occurrence of a heart attack; - Apply predictive models - decision trees, logistic regression, artificial neural networks and an ensemble – to predict whether a person develops an heart attack in the future; - Evaluate the complementarity used during the practical methodology for the support of the final results; - Understand in which way this methodology is useful and shows a scientific contribute for the prevention of future problems; - Analyse the importance of the information extracted from the model, as well as the respective selection of variables for the predictive modelling, whose goal is to attribute to a specific person his/her possibility of having the disease in the future; 1.4. DOCUMENT STRUCTURE The project is organized in different phases which are divided and described in this document, structured as follows: Chapter 2: Literature Review - a chapter focused on the literature review, containing all the theoretical survey regarding data mining meaning and techniques such as machine learning and predictive models, and also, research about heart diseases; Chapter 3: Research Methodology - contains the structure of the methodology applied in this project which starts by the definition of the methodology, followed by the practical steps, and the description of the methodological procedures to be done; Chapter 4: Results and Discussion - the chapter where the final results are described and the best model is selected after the implementation of the predictive models; Chapter 5: Conclusions - includes the conclusions and exploratory analysis of the output data that is more favourable and give more value to the study goal; Chapter 6: Limitations and Recommendations for Future Work - the final chapter where there are covered the limitations encountered during the project and recommendations for future work; 16 2. LITERATURE REVIEW This second chapter presents the literature review that is most important for the work project. By making a main framework of the topics, it allows a better intuitive understanding of the referred concepts that will be focused and divided along the chapters. This review is done accordingly with the related subjects that are considered for the preparation of this project, which covers in majority data mining, machine learning, predictive algorithms, and cardiovascular diseases. 2.1. INTRODUCTION TO DATA MINING AND MACHINE LEARNING Data Mining Through the last years our society has been facing a huge increase in the use of information technology and information systems, and consequently, the production and storage of large volumes of data, which is in constant growth. It is estimated that more than 90% of the knowledge we have nowadays started to be acquired in 1950 (Nisbet, Elder, & Miner, 2009). This applies to data that flows in our personal life and to the world we live in, regarding education and health sectors, commerce, and industries. It is evaluated that the volume of data stored in different databases around the world doubles every 18 (Maheshwari, 2015) or 20 months. As this volume is continuously growing, there is an important subject to be referred: the understanding of this data. A critical success factor for companies is their capacity to handle all this information, which turns out to be a difficult challenge as the more information volume they have, the less will be the data proportion a human being can analyse (Witten & Frank, 2002). Under all the layers of data that is collected, stored, and managed through the different devices, systems and others, there are useful patterns and hidden information that if transformed and analysed, can be crucial and lead to important results, which afterwards will have an impact on the day-to-day businesses decisions. This is all possible because of Data Mining, a buzz term that aims to analyse data present in databases and solve problems with it, by automatically or semi-automatically process data, discover patterns, and understand their relations (Witten & Frank, 2002). DM can be seen as a synonym for “knowledge discovery from data” as it is an important step for the knowledge extraction (Han, Kamber & Pei, 2012), and in its simplest definition is the capacity to detect patterns in the available data (Srivastava & Han, 2016). 17 In sum, DM is characterized by a process that generates a pipeline composed by different phases, that must be followed to achieve the desired results. A typical data mining application workflow contains a first phase called data collection, followed by data preprocessing, and a final analytical processing/algorithm phase. This pipeline can be viewed in figure 2, where the building blocks represent a particular design for an application solution (Aggarwal, 2015). The first phase, as the name suggests, consists of collecting the data through the use of software and hardware tools, and then, storing it in a database or data warehouse for the preprocessing (Aggarwal, 2015). This is a critical stage because in order to learn from data, there is the need to collect quality data so good choices made may significantly impact the data mining process (Maheshwari, 2015). Continuously, there is the preprocessing phase which englobes the extraction of features and data cleaning. The purpose is to put data in its suitable form to be preprocessed, for instance, transform it into a format that DM algorithms can understand, such as multidimensional, semi-structured format or time series. By doing this, the most relevant data features of an application are extracted from various and distinct sources and grouped in a combined format (Aggarwal, 2015). The quality of the data is critical for the success, so data cleaning is done in parallel because it usually contains inconsistencies to be removed, and missing values and errors that should be corrected and estimated. There are many ways to solve this, such as dealing with missing values, analyzing the outliers’ effects, and transforming fields or variables (Maheshwari, 2015). Finally, the last phase is the analytical processing which is responsible for the design of an effective analytical method, that is dependent on the experience of the analyst that is working on it (Aggarwal, 2015). Figure 2 - Data Mining Flow. Adapted from Data Mining: The Textbook, (p. 4), by C. Aggarwal, 2015, New York, NY: Springer. Copyright 2015 by Springer International Publishing. 18 There are two main types of data mining processes – supervised learning and unsupervised learning – which will be covered hereafter, but for both types it is necessary to validate their results. For that, a common approach is making use of the confusion matrix (figure 3) which gives the precision capacity and generalization of the created models. Some of the common metrics used are: Predictive Accuracy = (TP+ TN) / Nr of Total Predictions; Error = (FP + FN) / Nr of Total Predictions; Precision= TP / (TP + FP); A True positive -TP- is a true prediction when it is classified as true positive. In the same way, TN - True Negative – happens when it is truly classified as negative. On the opposite meaning, there is FN - False Negative – that appears when a true positive point is labelled as negative but is not a correct prediction of the model. Similarly, FP – False Positive – happens when a true negative value is estimated as positive one. This is how a confusion matrix should be interpreted. Usually, every classification technique used for prediction has an accuracy value related to a specific predictive model. The maximum value that it can reach is 100 percent, but in fact, the models that show 70 percent or more of accuracy are trusted and considered to be used in different business fields, depending on their business nature (Maheshwari, 2015). Figure 3 - Confusion Matrix. Adapted from Business Intelligence and Data Mining , (p.51), by A. Maheshwari, 2015, New York, NY: Business Expert Press. Copyright 2015 by Business Expert Press. 19 Data Mining Techniques Data Mining covers a variety of applications and techniques that vary depending on the goals, assumptions, problem knowledge and the data being used. Those techniques constitute keys elements for the modeling process, and as Berry and Linoff (2004) say, the most common can be grouped in two categories named (1) descriptive and (2) predictive modeling. The first one is a type of modeling that aims to obtain summary descriptions and patterns of the data that is being used, so the analysts can understand it and increase their knowledge about the database. Usually, it includes different methods such as segmentations, cluster analysis, and association rules. The second technique is different from the previous one, as it can be divided into classification or regression, depending on what we want to predict. In general, it works by learning from the existent data, and then choosing a decision criterion to classify new unknown examples. For instance, predict correlations between products and direct them for marketing campaigns (Sondwale, 2015). DM consists of merging different areas of interest, such as data analysis, artificial intelligence and learning models (Nisbet et al., 2009). Making use of these theories and tools will help humans on the extraction of useful information from large amounts of data, and also, on making the base for the knowledge discovery process in databases (Lavalle, Hopkins, Lesser, Shockley, & Kruschwitz, 2010). Machine Learning ML (Machine Learning) is another important term related to DM. ML differs from DM as it represents the techniques, more specifically, the algorithms used during the DM process to acquire the structural description from the raw data (Patterson & Gibson, 2017). ML algorithms represent methods used by data scientists to uncover patterns in big data, and those can be categorized in two main groups depending on the methodology used to learn data: supervised learning or unsupervised learning. The first one, being the most used, requires that the training data - data used for the algorithm learning - is labeled with corrected and known answers, meaning that it has the correct values of the target variable it needs to predict. The algorithm will learn from its training dataset and make predictions on new data. Some examples of this type of learning are linear and logistic regression, classification, and decision trees (Castle, 2017). On the other hand, the unsupervised learning refers to the idea that computers can learn, describe data, identify patterns and processes without a human to provide guidance, which means there is no need to learn from predefined labels. 20 In this type of learning, the algorithms learn to identify the patterns without a specified target variable, but with the behavior of the independent variables, so they can apply that knowledge and try to predict the actions or groups of the new elements (Chitra & Subashini, 2013). Some unsupervised learning examples are PCA (Principal Component Analysis), K-means Clustering, and Association rules (Castle, 2017). A summary of data mining techniques and algorithms is described in figure 4. 2.2. ALGORITHMS FOR PREDICTIVE MODELING Predictive analysis and modeling consist of using data, algorithms, and ML techniques to identify and forecast future outcomes, taking into account available historical data. With predictive analytical tools and models, organizations and businesses can transform their data and generate useful future insights with a good degree of precision, which will be crucial to forecast trends and behaviors, and lead to better decisions (Edwards, 2015). As previously described, predictive models can be classified in two types: Regression and Classification. Figure 4 – Models and Algorithms used in Machine Learning (Source: Author Based) Machine Learning Supervised Learning Classification Neural Networks Support Vector Machines Decision Trees | Random Forets Logistic Regression KNN Regression Linear Regression Decision Trees | Random Forest Unpervised Learning Clustering K-Means K-Medoids Dimensionality Reduction Association Rules 21 The first one can be divided into linear and logistic regression, and the goal is to use input variables to approximate a mapping function to a continuous dependent variable, the output. This process demands the prediction of a certain quantity, where the final output may be a real value such as a floating point or an integer. In classification, on the other hand, the goal is to use input variables to approximate a mapping function to classes, meaning the dependent variable is a category or label, and the observations are classified into one of two or more classes. For instance, an email can be assigned as “spam” or “not spam” (Brownlee, 2017). Classification is one of the most common tasks used in DM field, and the hole process is seen as a classification model development of the reality. In fact, in order to learn and understand the world we live in, we are making constant classifications which is how we can distinguish, for example, people from animals, objects and facts. The general flow of a classification process can be seen in figure 5, where the learning and classification phases are distinct. To develop a predictive model, different algorithms can be used. For this effect, and to better distinct the algorithms used in the project, in this chapter a revision about each of them will be made. This part will be followed by a theoretical analysis of the problem in question, focusing on the cardiovascular disease topic, and on the use of technologies and DM techniques in medicine. Figure 5 - General View of Modulation of the Prediction Process – it starts by a pre-classified training dataset (the examples), where through the use of an algorithm (for instance, decision tree, regression or neural network) is extracted knowledge that will be consequently applied for the classification of new unknow elements (F. Bação, personal communication, June 15, 2019). Learning Examples (Training data) Algorithm Knowledge Examples (New data) Classifier Classification Classification 22 2.2.1. Artificial Neural Networks Introduction to Artificial Neural Networks The first model to be referred, and one of the main classification methods used in ML are ANN - Artificial Neural Networks. These networks were already a topic of study and research in the middle of 20th century (Deng & Yu, 2014), and like the “neural” part of the name indicates, they are networks inspired by the way our brain works and processes the natural signs, and they intend to replicate its behavior, specifically, the method of human’s learning. The ANN term took shape during the middle of XX century, when McCulloch and Pits presented in their paper a simplified model of a neuron (McCulloch & Pits, 1943). ANN are composed by neurons, the principal unit or processing element, which represent analogically the neuron in the biological brain, and are modelled by them. Neurons make a dense and complex network by connecting with each other using signals, which is the way they learn and train themselves. Between the units there are weights, that are the primary means of long-term information storage in neural networks, and their update is the primary way neural networks learn new information (Patterson & Gibson, 2017). A neural network is seen as an artificial intelligence method which can solve different problems (Wang & Raj, 2017), and it is an optimal choice when the problem is difficult to specify or there is a lack of knowledge about it, but there is sufficient data (Zhang, Patuwo, & Hu, 1998). There are different architectures to represent neural networks, which can go from one SLP (Single Layer Perceptron) to more complex structures - the MLP (Multilayer perceptron). These architectures display the connections between the nodes, and they are the key for the effectiveness of the neural network used (Aggarwal, 2015). Single Layer Perceptron The SLP, name given by Rosenblatt, is the simplest form of a neural network. He defended that its design represented some of the basic functionalities of intelligent systems, as well as its analogy to biological systems, such as the human brain. This fundamental unit is also called neuron or node, and it is intended to receive input from external sources or further neurons to compute an output. The SLP is composed by a weight w that is associated with each input, and which is assigned taking in consideration its importance with the other remaining inputs. 23 This representation is seen bellow in figure 6, where X1 and X2 are numerical inputs, and W1 and W2 are their respective weights. Each signal X is integrated in a neuron and multiplied by a weight W, being the final value the sum of the remaining product. The node will then use a function - the activation function f - to the previous summed value, which contains another input represented by b, named bias. The aim of the bias is to add a constant value to each node, which will give more flexibility to the model to adapt and fit the data. Finally, the output represented by Y is calculated through the activation function, which takes the previous summed value and applies a mathematical operation on it, squashing the final value to a specific number rage, and determining the output, accuracy, and efficiency of the training model. The activation function is linked to each neuron, making it possible to define the activation or nonactivation of the neuron, considering the relevance of each node’s input for the prediction of the model (Sharma, 2017). As most of the data used nowadays is non-linear, the aim of this calculation is to introduce non-linearity to the neuron’s output, so they can master and learn the representations that are not linear (Ujjwalkarn, 2016). The activation function, also known as transfer function, is used to understand the final result of an ANN, such as a “Yes” or “No”, by mapping the result in ranges from -1 to 1, or 0 to 1, based on the function that is being used (Sharma, 2017). Figure 6 - Single Layer Perceptron. Adapted from A Quick Introduction to Neural Networks, by Ujjwalkarn, 2016, Retrieved from https://ujjwalkarn.me/2016/08/09/quick-intro-neural- networks/. Copyright 2016 by Ujjwalkarn. ( Activation Function ) Output of neuron = f ( w1 * x1 + w2 * x2 + b ) 24 The activation function is a non-linear function, as adding non-linearity to the network avoids the restrictions with linear functions and allows the learning of compound networks. In ANN field there are distinct activation functions that may be applied, being the most common described below: Sigmoid: the function takes a real input value and compresses it into an interval ranging from 0 to 1. The Sigmoid is mostly used in feedforward networks that need positive outputs, introduces nonlinearity, and is a simple derivative function (figure 7); Hyperbolic Tangent: the function is also called Tanh, and it takes a real input value and compresses it into an interval ranging from -1 to 1. Unlike the first function, tanh’s output is zero-centered, and the gradient is stronger (figure 8); Figure 7 - Sigmoid Activation Function. Adapted from Understanding Activation Functions in Neural Networks, by A. Sharma, 2017, Retrieved from https://medium.com/the-theory-of-everything/understanding-activation- functions-in-neural-networks-9491262884e0. Copyright 2017 by A. Sharma. Figure 8 - Hyperbolic tangent Activation Function. Adapted from Understanding Activation Functions in Neural Networks, by A. Sharma, 2017, Retrieved from https://medium.com/the-theory-of-everything/understandingactivation-functions-in-neural-networks-9491262884e0. Copyright 2017 by A. Sharma. 31 The created rules will be applied to the observations of the validation dataset, and after, will allow the prediction of future behaviors regarding the values assumed by the target variable. Over the years, numerous DT algorithms were developed, for instance, CART (Breiman, Fiedman, Olshen & Stone, 1984), ID3 (Quinlan, 1986), SPRINT (Shafer, Agrawal, & Mehta, 1996) and CHAID (Milanović & Stamenković, 2016), but for the purpose of this project the focus will be placed on the behavior of ID3 and CART. ID3 Algorithm ID3 algorithm stands for Iterative Dichotomiser 3, as it iteratively divides at each step the features in different groups. The algorithm was invented by Ross Quinlan and it employs a top-down approach, meaning that trees are constructed from the top, root node, and at each repetition the best feature is selected, and a node is created. ID3 is applied for cases with a high number of attributes whose training set contains several objects, and for reasonable DT that do not require too much computation. This algorithm has an iterative structure, as a subpart of the training set is randomly chosen, and a DT is constructed from it. The other part of the training set is hereafter classified using the constructed tree (Quinlan, 1986). Typically, ID3 is used for nominal classification problems (Sakkaf, 2020), and it can be synthetized through the following rules (Rita, 2018): Split Criterion (node, (examples): A ← best aribute for spling the (examples) Decision attribute for this node ← A For each new child node Split training (examples) to child nodes For each child node / subset: If subset is pure: STOP Else: Split (child_node, (subset)) 32 Following these rules will result in the construction of a new DT, that in the presence of new observations may obtain a predicted value for the target by following the branches of the tree. In order to choose the most important feature the ID3 algorithm makes use of Information Gain. This nomenclature calculates the reduction in the Entropy (Wang & Suen, 1984), which estimates the level of order or disorder of the target dataset, and determines if the given feature separates the target classes well. The feature with the highest Information Gain value is then selected as the right choice. For instance, if we designate an example dataset as S, the Entropy may be determined through the following expression (Sakkaf, 2020): where, n represents the total number of existing classes in the column of the target (for example, n=2 if the target class has two possibilities: “Yes” or “No”); pᵢ is the ratio of the number of rows with a specific class i in the target column n, in the total number of rows of the dataset S (Sakkaf, 2020). Assuming that dataset S has a total of 14 rows, with 3 feature columns: “Fever”, “Cough” and “Breathing Issues”, the representation will be as seen in table 1: Entropy (S) = - ∑ pᵢ * log₂ (pᵢ); i = 1 to n Table 1 - Dataset S Example. Adapted from Decision Trees: ID3 Algorithm Explained, by Y. Sakkaf, 2020, Retrieved from https://towardsdatascience.com/decision-trees-for-classification-id3-algorithm-explained- 89df76e72df. Copyright 2020 by Y. Sakkaf. 33 The table has two different target values (Infected column): 8 rows for “Yes” and 6 rows for “No”, hence, the entropy may be determined by the following expression (Sakkaf, 2020): The highest the Entropy, the higher the measure of disorder will be, which means more randomness. On the other hand, the lowest the Entropy, the less the measure of disorder will be, which turns out to be the goal of machine learning models, to reduce uncertainty (figure 13). Consequently, by having the Entropy value it is possible to calculate the Information Gain, which measures how much information has been gained through a given choice at a given node. It is defined as the influence of the knowledge of a feature at a specific node. This influence is determined by the Entropy, previously calculated on the first place, so then the Information Gain can be applied by the following expression (Sakkaf, 2020): where, v are the classes the target can assume, for instance, v=”yes” or v=”no”; Sᵥ is the number of rows in the dataset S with a specific feature A of value v; |Sᵥ| is the absolute value of the number of rows in Sᵥ; |S| is the absolute value of the total number of rows in S. IG (S, A) = Entropy (S) - ∑((|S ᵥ | / |S|) * Entropy (S ᵥ )) Entropy (S) = — (8/14) * log₂(8/14) — (6/14) * log₂(6/14) = 0.99 Figure 13 - Representation of the Entropy Relation. Adapted from Model Selection for Data Analysis Based on the MDL Principle, (p.122), by B. S. Nonchev, 2015. Copyright 2015 by B. S. Nonchev. 34 Continuing with the example of dataset S, the calculation of the Information Gain will be made. The process should be applied to all the feature columns in order to calculate the different Information Gain values, but for the purpose of this practical explanation, it will only be explained for “Fever” feature as it is detailed bellow (Sakkaf, 2020): |S| = 14 For v = YES, |Sᵥ| = 8 Entropy (Sᵥ) = - (6/8) * log₂(6/8) - (2/8) * log₂(2/8) = 0.81 For v = NO, |Sᵥ| = 6 Entropy (Sᵥ) = - (2/6) * log₂(2/6) - (4/6) * log₂(4/6) = 0.91 Entropy (S) = 0,99 IG(S, Fever) = 0.99 - (8/14) * 0.81 - (6/14) * 0.91 = 0.13 By applying the same calculations to the other features, the process will end with the following Information Gain values: - IG (S, Fever): 0,13 - IG (S, Cough): 0,04 - IG (S, Breathing Issues): 0,40 Since the calculation of the Information Gain values is done, the DT can be started with the choice of the root node, which is the feature with the highest IG value. By looking at the results, the root node will be “Breathing Issues”, and the initial step would look like this (figure 14): YES NO Figure 14 - Root Node of Decision Tree (Source: Author-based) Breathing Issues IG(S, Fever) = Entropy(S) - (|S ʏ ᴇꜱ | / |S|) * Entropy(S ʏ ᴇꜱ ) - (|S ɴ ᴏ | / |S|) * Entropy(S ɴ ᴏ ) 35 In recap, by having the Information Gain it is possible to select at each step the best feature, the one that has the highest value, and create a decision tree node. This process continues recursively, and if all the rows are considered to be in the same class, the actual node is set to a leaf node where the label will be the current class. When all the features are seen, or if all the decision tree nodes become leaf nodes, it means the tree is finished (Sakaff, 2020). Overfitting and Pruning ID3 is a recursive algorithm, so it divides the training dataset into smaller subsets till they are pure. This means there may exist parts that contain only one observation, which is not necessarily good, as we may be in the presence of overfitting. In due course, each leaf will represent a small group of feature combinations that are included in the training set, and the tree will posteriorly be unable to classify specific feature values that were not visualized in that data. In this way, the overfitting problem happens when training data is memorized very well by the model, and it learns noise and random features on instances belonging to the training data (Hoare, 2017). Looking at figure 15, it is seen that the highest the number of decision nodes in the training set, the better the tree precision level will be. However, in the validation set this precision level decreases on a certain point, as the size of the tree increases. This is due to the fact the algorithm becomes too specific for the training set, being incapable of generalizing and leading to DT structures with more complexity than the necessary. Figure 15 – Precision Level of a Decision Tree. Adapted from A Comprehensive Guide to Decision Tree Learning, by A. Chavan, 2019, Retrieved from https://www.aitimejournal.com/@akshay.chavan/acomprehensive-guide-to-decision-tree-learning. Copyright 2019 by A. Chavan. Tree size (number of nodes) Accuracy On training data On test data ----- 36 One way of avoiding this problem is by pruning the tree. Pruning is an approach used in DT and aims to reduce their size by removing the lower leaves of the structure that do not add valuable information – the capacity to classify new cases. As DT are likely to suffer from overfitting, an effective pruning or an early stop can reduce this likelihood (Hoare, 2017), but at the same time, maintaining the predictive accuracy as measured by a cross-validation set (Mangale, 2017). Pruning can be named post-pruning when the tree is created in the first place, and in consequence, the non-significant branches are removed. However, it is also called pre-pruning when during the construction of the tree it is decided to stop developing some parts and terminate them, which turns out to be an interesting approach as it would reduce the probability of spending time and work on creating subtrees that afterwards would be discarded and not used (Witten & Frank, 2002). There are two main techniques of doing post pruning: the Reduced Error Pruning, and the Cost Complexity Pruning. The first one, was proposed by Quinlan and is the simplest and the most understandable method while doing pruning. It considers that each of the decision nodes are candidates for pruning by removing a subtree rote node into a leaf node. REP will perform this operation if it does not increase the total number of classification errors. The process begins with the full structure of the tree and will go through each node to compare the number of classification errors made when the subtree is remained, with the number of errors made when the current node is transformed into a leaf node linked to a labelled class. Pruning is advisable if the simplified tree shows greater results than the one in the beginning. The process is iterative and will chose the nodes that enlarge the DT accuracy on the pruning set when removed (Patel & Upadhyay, 2012). The second method, Cost Complexity Pruning also known as Weakest Link Pruning, is focused on estimating the error cost of a node and works by calculating the tree score. This method considers a function of the number of leaves in the DT and its error rate, which represents the percentage of the misclassified set. This cost will be computed for each node starting at the lowest leaves of the subtree, and it can be calculated in two ways: if the subtree was meant to be pruned, and if it was not. These two values are then compared, and if the first one shows a smaller cost pruning is done in the subtree, otherwise the structure remains the same (Han et al., 2012). 37 CART Algorithm CART, which stands for Classification and Regression Trees, is on the other hand a binary DT containing specifically two branches for each decision node. This method was suggested by Breiman et al. (1984), and it recursively partitions the records of the training data into subsets, two child nodes, with similar values for the target variable (Larose, 2015). The methodology of this algorithm is based on three parts (Timofeev, 2004): 1. Construction of a DT with a maximum size – In the first phase the algorithm will split the training dataset till the final nodes hold observations of only one class. For the splitting process it is used a function called Gini Index or Gini Impurity, represented by the following expression: Where pi is the instance’s probability of being classified into a specific class. The Gini Index measures the purity (Silipo & Melcher, 2019), the degree of a particular variable not being correctly classified when it is chosen in a random way. It varies on a scale from 0 to 1, where 0 indicates that all instances are part of a certain class, and 1 indicates that all instances are distributed randomly amongst different classes. After the Gini Index is calculated for all the feature classes, the lowest value (maximum reduction of impurity) will be select as the root node for the new DT. The goal is to choose decision variables that create subsets that are most close to a pure value, which is 0. 2. Definition of the best DT size - The second phase aims to optimize the trees before they are used for new data classification, because their maximum size may reflect too many levels and a high complexity. For this, pruning algorithms are used in order to cut of insignificant nodes and subtrees, so the accuracy of the DT increases. 3. Classification of a new dataset based on the built DT – The DT that is being developed will have two utilities: classification or regression. The result of this phase is a label class or value to each of the new instances, that by answering the tree questions will lead to one of the node terminals. Gini (t) = 1 - ∑ 𝑝    38 2.2.3. Linear and Logistic Regression Regression is a concept that characterizes functions with the goal of predicting real values outputs, that by knowing the independent variables estimate the dependent one, meaning that it describes the linear dependence of the outcome variable from one or more predictor variables. Regression can be categorized in two groups: linear and logistic regression (Tripepi, Jager, Dekker & Zoccali, 2008). Linear regression is the most common class of regression, and attempts to create a function that can describe the relationship between the variable X and Y, where by having the values of X, it can predict the values of Y in an accurate way. This is used to describe the linear dependence of the outcome variable - the dependent one - based on the independent variables, called the predictors. This is a commonly used technique, because it is appropriate to evaluate the relationship’s strength between two variables (Bakar, Mohemad, Ahmad & Deris, 2006). Linear Regression is modelled by using the equation bellow: Where Y is the dependent variable, X the parameter vector, a is what intercepts Y, and B represents the input features. The previous equation can be expanded to the following one: In a visual way, linear regression is designed as a straight line in a bi-dimensional plan, and its goal is to find the line that best fits the points, being close to the most numbers of points as it is shown in figure 16. Figure 16 - Linear Regression Plotted. Adapted from Deep Learning: A Practitioner’s Approach, (p.46), by J. Patterson and A. Gibson, 2017, Sebastopol: O’Reilly Media. Copyright 2017 by J. Patterson and A. Gibson Y = 𝑎 + 𝐵  Y = 𝑎 + 𝑏  * 𝑥  + 𝑏  * 𝑥  + … + 𝑏  * 𝑥  39 While linear regression deals with continuous dependent variables, logistic regression on the other hand is a statistical method that represents the relationship between continuous or discrete independent variables, and the target, which is a categorical variable (Tripepi et al., 2008). It is also called a binary logistic model because by assuming the input variables, it aims to evaluate the probability of a binary result, where the output will be a probability of a specific category based on the predictors. In logistic regression the logistic function can be defined as follows in figure 17: The logistic regression function, being a continuous log-sigmoid function, is extremely useful as it takes different inputs from negative to positive infinity ranges and put them in a range between 0 and 1, allowing the interpretation of the output value as a probability with only two possible values, a dummy variable. In this function, f(x) is the probability of Y equals 1 given each X input. For instance, if our goal is to determine the probability of an email being spam and if f(x) equals to 0.6, we could formulate that Y has 60 percent of probability of being 1, which means that given the input, the email shows 60 percent of possibility of being spam. Figure 17 - Logistic Regression Function and Plot. Adapted from Deep Lea rning: A Practitioner’s Approach, (p.66), by J. Patterson and A. Gibson, 2017, Sebastopol: O’Reilly Media. Copyright 2017 by J. Patterson and A. Gibson 40 2.2.4. Ensemble Models An ensemble model is a classification and a composite methodology, that by combining independent and different classifiers known as base learners (Garg, 2018), increases the classification accuracy, resulting in a more powerful model (Han et al., 2012). Ensemble helps on reducing the noise, variance, and bias, which are weaknesses of independent models (Garg, 2018), creating at the end a better solution (Augusty & Izudheen, 2013). Mostly, ensemble techniques can be classified in Bagging and Bosting. Bagging, or Bootstrap Aggregating, has the primary advantage of reducing the model variance (Bühlmann, 2012), and is a simple and efficient method for the creation of samples (bootstrap samples) from the original dataset, that will bring diversity to the model (Flach, 2012). This algorithm starts by repeatedly taking these samples with replacement and equal size from the training dataset, so that every record has the same probability of being chose. Afterwards, an estimation or classification model is trained on each bootstrap, so that each model is trained with different observations and a prediction is done for all. Bagging builds many independent predictors and combines them using model averaging techniques such as majority vote, weighted average, or normal average. An example of bagging ensemble is Random Forest Model (Grover, 2017). The second technique – Boosting – is similar to the first one, but has a more sophisticated manner to create a variety of group samples, giving more prominence on choosing the points with incorrect predictions, so the accuracy can be improved (Bühlmann, 2012). Boosting is primarily focused on reducing the bias and differs from bagging because it is an adaptative algorithm, where the predictors are not made independently in parallel, but sequentially. This logic means that the subsequent predictors learn from the mistakes of the previous ones, and by subsequently adding models, it reduces the classifier’s error. In this technique each training instance is assigned with a weight that will be used for the training of the various classifiers (Aggarwal, 2015). The weights are then modified at each iteration and the same classification model is applied to the training sample, however, at each repetition the algorithm will apply a higher weight to the misclassified instances, in order to emphasize the most difficult cases. By doing this, a new classifier will be able to correct the bias on these specific data (Larose, 2015). In this way, the algorithm works by fitting new models to the errors of the previous ones, focusing on improving the overall prediction. The future models will be dependent on the previous results and will end in the construction of a new classifier with lower overall bias (Aggarwal, 2015). 47 The use of DM approaches in CAD, CVD, and CHD showed to be encouraging, but although the heart disease predictions do not have an accuracy of 100%, and hence must not be used alone for the process, it is seen that these results are promising to be used and would assist the professionals on making early diagnosis, on decision making, on preventing the diseases, and on saving more humans from heart attacks (Alzahani et al., 2014). Because of the prosperous application of DM methodologies for heart diagnosis, a few prediction systems that already use the previous techniques have been proposed (Palaniappan & Awang, 2008). There are also other types of studies on cardiovascular diseases and their diagnosis, and research has provided different methodologies for the treatment of such diseases (Khan et al., 2017). For instance, Milan Kumari designed a system named RIPPER that stands for Repeated Incremental Pruning to Produce Error Reduction, and it is a rule-based classification algorithm that generates rules matching the performance of DT. Babaoglu et al. (2009) studied the use of ANN to determine the existence of artery disease based on the exercise stress testing, and other techniques like DT and SVM were also applied to explore datasets of coronary diseases, and different accuracy results were obtained (Parthiban, Rajesh & Srivatsa, 2011). Anbarasi et al. (2010) assessed the use of CART and ANN with the intent of predicting heart diseases in individuals, and Detrano et al. (1989) did different investigations to predict the heart disease on a particularly useful dataset. On this case, the results showed that DT performance had highest accuracy, however, it was found that Bayesian classification had related truthfulness as that of decision tree method. Genetic Algorithm was also used by Anbarasi et al. (2010) to determine the attributes that have more influence on contributing to the diagnosis of the cardiac disease, and Detrano et al. (1989) performed experimental results that exhibited precise classification of heart diseases, having an accuracy of nearly 77% by using logistic regression (Srinivas, Rani, & Govrdhan, 2010). Different results were discussed regarding the prediction of any type of heart disease by applying DM techniques with their classifiers and extension of the classifiers, showing surprising results. Also, different research papers used distinct classifiers algorithms or techniques, such as SVM, ANN, and Naïve Bayes, as well as their extensions which are different types of DT, KNN, ANN, MLP, Genetic Algorithms, and Feature Subset Selections. 48 3. RESEARCH METHODOLOGY This section describes how the project’s methodology was conducted and the different phases that were followed to accomplish the final goal. The chapter will cover the practical methodology used, the description of the dataset, the necessary steps followed since the beginning till the choice of the best model, as well as the software chosen for the evolution of this project. To achieve a coherent structure, it was defined at the beginning a proposal with concrete steps that should be followed: 1st - Preparation: Definition of the project’s topic with the support of the project coordinator, as well as the goals to be achieved, the respective work structure, the dataset and the practical methodology to be used; 2nd - Literature Review: Include the theoretical investigation and the approach contextualized with the field being study - heart attack disease, predictive models, and the use of machine learning algorithms; 3rd - Development of the Model: Specification of the methodology steps followed for the construction of the model and their application and development within the chosen software; 4th - Presentation of Results: Presentation of the main results and discussion; 5th - Conclusion: Presentation of the conclusions giving answers to the investigation questions and to the defined goals; 6th - Limitations and Future Work: Specification of suggestions and recommendations to be done in future studies. 3.1. DEVELOPMENT OF THE MODEL - METHODOLOGY STEPS In DM field, conceptual models should be followed to provide guidance when planning and developing a project, in order to achieve the needs of any particular industry or company. The conceptual base model used in this project is named CRIPS-DM, which was conceived in 1996 by a consortium, and stands for “Cross-Industry Standard Process for Data Mining”. This approach is aimed to be a tool for industries and is composed by six phases that are adaptive, meaning the next phase often depends on the outcomes of the previous one. Figure 21 represents these phases connected by the arrows (Chapman, Clinton, Kerber, Khabaza, Reinartz, Shearer & Wirth, 2000). This conceptual sequence registers the life cycle of a DM project, and one of its main advantages is the fact that it is independent from the sector and from the analysis tool being used (Larose, 2015). 49 The model is not rigid, is complete, organized, and structured (Azevedo & Santos, 2008). The first stage is Business Understanding, which focus on looking for the project objectives and requirements from a business side, and it is considered the most important step as an incorrect analysis may influence the whole project, and consequently, its conclusions. It involves several steps, including business and data mining goals, as well as the production of the project plan (Shearer, 2000). Right after comes Data Understanding, where the collection and initial data analysis, insights, and quality is done. The third stage is Data Preparation, which groups all the activities required for the construction of the final dataset since its original raw form (Azevedo & Santos, 2008). This includes different tasks such as dimensionality reduction, data transformation methods, cleaning, and formatting. Modelling is the fourth phase where different model techniques are applied, and it is divided into four substages: the choice of modelling approaches, the test design, and the creation and evaluating of the model. On the fifth stage, the Evaluation, the model(s) are built and obtained. Before proceeding into the final model deployment, they are evaluated and their steps reviewed, to make sure they meet the business goals. Having this phase finished, a decision about the use of DM results may be reached. The final stage - Deployment - is where happens the process of planification and implementation of the model. As it is the last task, it should be made a review about the whole project, the identification of the positive and negative points, as well as the improvements to make in the future and the respective final report (Shearer, 2000). Figure 21 – Methodology Steps of CRISP - DM . Adapted from CRISP - DM 1.0: Step - by - st ep Data Mining Guide, (p.10), by Chapman et al., 2000, SPSS Inc. Copyright 2000 by the Members of CRISP-DM Consortium. 50 SEMMA© Having the conceptual base for the development of the project, the practical operationalization of the work is done by applying SEMMA©, which stands for Sample, Exploration, Modify, Model and Assess (figure 22). SEMMA© was developed by SAS Institute, a company of Business Analytics software that aims to subserve and facilitate the data exploration process and their treatment, and the software that will support this project is SAS Enterprise Miner 15.1, whose goal is to clarify the data treatment process so that predictive and descriptive models can be created with high precision based on the analysis of high dimensions of data, and allowing the construction of interactive process flow diagrams. As the name suggests, SEMMA© is composed by five stages with different meanings: Sample: creation of the input tables, partition, categorization, and data sampling; Explore: data exploration and variable selection, used to graphically and statistically explore the dataset to understand its clarity and organization. In this phase, it is also performed the elimination of outliers and the handling of missing values; Modify: Modification and variable transformation. In this step new variables are created from the initial ones in order to give value to the exploration and to the extracted knowledge. The existence of incoherencies and incorrected values are also checked; Model: Data modulation phase. At this point the dataset is divided in two parts: the training set representing 70%, and the validation set representing 30%. For the modulation process some variables are selected based on their correlation and worth. Assess: the final stage consists of the evaluation of the obtained results and model comparison; Figure 22 - Structure of SEMMA© Methodology (Source: Author Based) Sample Explore ModifyModel Assess 51 SEMMA© is an intuitive approach applied in a sequential way, with a user-friendly application allowed by SAS Miner tools and tasks. This process is conducted by a flow chart that can be modified and saved which allows the analyst of the business to understand the flow and the meaning of the new data. SAS Miner not only contains a group of tasks that can be combined so multiple models can be created and compared, but it also allows the detection of isolation points, variable transformation, sampling, data partition, and advanced visualization tools that provide a quick and easy analysis of the dataset. 3.2. DATASET The chosen dataset was provided originally from UCI Machine Learning Repository that englobes four databases linked with the related source. Having a total of 76 attributes, it was initially donated by David Aha, however, all the accessed experiments were done with a subset of 14 variables, with details of 303 patient’s information. This specific subset was extracted from Kaggle public website (Healthcare: Dataset on Heart attack possibility, 2020) and contains health cardiac indicators of this total 303 patients, which diagnoses the occurrence of a heart attack in a specific individual. The independent variables refer to health indicators, such as chest pain, blood pressure and cholesterol, and the dependent variable - target - characterizes the occurrence of a heart attack in an individual. This variable has a value of 0 if there is no/less chance of heart attack, and assumes the value of 1 if there is more chance of having the problem. 3.3. DATA ANALYSIS AND EXPLORATION Variable analysis and Classification Having the dataset defined and extracted, the initial action is to import it to SAS Enterprise Miner with the use of File Import Node. Then, understanding the variables of the dataset is important, which includes the register of their name, meaning, and level. There are a total of 14 Input variables, where 4 are binary and 10 are interval, and 303 records. Table 4 summarizes this information: 52 V ARIABLE N AME V ARIABLE D ESCRIPTION V ARIABLE L EVEL A GE INDIVIDUAL’S AGE IN YEARS I NTERVAL S EX INDIVIDUAL’S GENDER - 1: MALE | 0: FEMALE B INARY C HEST P AIN T YPE ( CP ) CHEST PAIN CLASSIFIED IN VALUES: - 0: TYPICAL ANGINA - 1: ATYPICAL ANGINA - 2: NON-ANGINAL PAIN - 3: ASYMPTOMATIC PAIN I NTERVAL BLOOD PRESSURE (TRESTBPS) RESTING BLOOD PRESSURE IN MM HG. (ABOVE 130-140 IS A CAUSE FOR CONCERN) INTERVAL CHOLESTEROL (CHOL) MEASUREMENT OF SERUM CHOLESTEROL IN MG/DL. (ABOVE 200 IS A CAUSE FOR CONCERN) INTERVAL FASTING BLOOD SUGAR (FBS) MEASUREMENT OF HOW A PERSON’S BODY IS MANAGING BLOOD SUGAR. (FBS> 120 MG/DL SIGNALS DIABETES) VALUE 1: > 120 MG/DL | VALUE 0: < 120 MG/DL BINARY ELECTROCARDIOGRAPHIC RESULTS (RESTECG) RESULTS OF THE ELECTRICAL ACTIVITY AND RHYTHM OF THE HEART - VALUE 0: NORMAL - VALUE 1: HAVING ST-T WAVE ABNORMALITY (T WAVE INVERSIONS AND/OR ST ELEVATION OR DEPRESSION OF > 0.05 MV) - VALUE 2: PROBABLE OR DEFINITE LEFT VENTRICULAR HYPERTROPHY INTERVAL M AXIMUM H EART R ATE ( THALACH ) HIGHEST VALUE OF HEART RATE ACHIEVED IN MIN/BEAT ACHIEVED DURING THALIUM STRESS TEST I NTERVAL E XERCISE I NDUCED A NGINA ( EXANG ) ANGINA INDUCED BY EXERCISE VALUE 1: YES | 0: NO B INARY O LDPEAK ST DEPRESSION (ELECTROCARDIOGRAM TERM) INDUCED BY EXERCISE RELATIVE TO REST I NTERVAL S LOPE THE SLOPE OF THE PEAK EXERCISE IN ST SEGMENT 0: UPSLOPING |1: FLATSLOPING | 2: DOWNSLOPING I NTERVAL N UMBER OF M AJOR V ESSELS ( CA ) NUMBER OF MAJOR VESSELS COLORED BY FLUOROSCOPY (0 - 4) I NTERVAL THALASSEMIA (THAL) THALIUM STRESS TEST RESULTS: 0: NORMAL | 1: FIXED DEFECT | 2: REVERSABLE DEFECT INTERVAL TARGET VARIABLE (DEPVAR) HAVE OR DON’T HAVE THE DISEASE 0: NO |1: YES BINARY Table 4 -Variable Description. Adapted from Healthcare: Dataset on Heart attack possibility, by R. Rahman, 2020, Retrieved from https://www.kaggle.com/rashikrahmanpritom/heart-attack-analysis-prediction- dataset). Copyright 2020 by Kaggle. 53 Data Exploration Secondly, the analysis of interval and class variables is done in more detail using StatExplore Node, which allows to make a statistical analysis and to understand better the different values, as well as the patients’ features (table 5 and table 6). At a first glance it is concluded that both interval and class variables do not have missing values, and the individual’s age varies between 29 and 77 years, which makes this sample of people with a mean of 55 years. In this group of patients, the dependent variable tells us that 54.46% had a heart attack (165 people) and 45.54% (138 people) did not have. Table 5 - Interval Variables Summary Statistics (Source: SAS Miner Output, 2020) Table 6 - Class Variables Summary Statistics (Source: SAS Miner Output, 2020) 54 3.4. DATA PREPROCESSING After analyzing and exploring the dataset, it is important to prepare the data as it is a large part of the Data Mining process. This phase allows to find impurities, such as outliers and incoherencies that should be eliminated or cleaned. For this, data pre-processing techniques are used to guarantee the proper condition of data, so it can be correctly used by the future models. 3.4.1. Outlier Detection and Removal Outliers are observations that are located on the extreme boundaries of the dataset. The goal is to look for these values and handle them, because they can negatively impact the performance and quality of the model. To do so, the Multiplot node was used to check the existence of outliers, and the Filter Node used to exclude them by using a manual filtering method that allows the elimination of the values that represent obvious extreme values, in this case, on three variables: “cholesterol”, “max_ heart_rate” and “oldpeak”. After this process is made, the output shows the exclusion of only 4 outliers, resulting in 299 records which represents 1.3% of the dataset (Appendix 2). 3.4.2. Missing Values Missing values within data can be problematic for some algorithms, such as regression and neural networks, because it can lead to the weakness of the predictive power. In order to deal with missing values it is used the Impute Node that fills the values that were missing, but as the dataset did not show this problem, there was no need to apply this for this case. 3.4.3. Coherence Checking In this step, the consistency of the data is checked to make sure the program is dealing with corrected and meaningful values. For this purpose, SAS Code node is used allowing the introduction of new expressions to validate data (table 7). INCOHERENCE CODE DESCRIPTION Negative Age Incoherent_age= 0; If (age) <0 then do; Incoherent_age= 1; */delete/* End; The patient’s age needs to be a positive number Variable Coherence Checking Description (Source: Author based) Table 7 - Variable Coherence Check ing Description (Source: Author based) 55 3.4.4. Data Transformation At this step, SAS Code node is used again to transform variables with the intent of creating new ones that can facilitate and improve the modulation process. For this project, it was decided to turn 3 variables into categories. Table 8 summarizes these transformations: V ARIABLE C ODE M EANING age_cod age_cod=""; IF age>=29 and age<=38 THEN age_cod="1"; ELSE IF age>=39 and age<=48 THEN age_cod="2"; ELSE IF age>=49 and age<=57 THEN age_cod="3"; ELSE IF age>=58 and age<=67 THEN age_cod="4"; ELSE age_cod="5"; Transformation of variable Age into classes of ages cholesterol_cod cholesterol_cod=""; IF cholesterol>=126 and cholesterol<=180 THEN cholesterol _cod="1"; IF cholesterol>=181 and cholesterol<=234 THEN cholesterol_cod="2"; IF cholesterol>=235 and cholesterol<=288 THEN cholesterol _cod="3"; IF cholesterol>=289 and cholesterol<=342 THEN cholesterol="4"; ELSE cholesterol="5"; Transformation of variable Cholesterol into classes of cholesterol max_heart_rate_cod max_hear_rate_cod=""; IF max_heart_rate>=71 and max_heart_rate<=107 THEN max_hear_rate_cod= "1"; IF max_heart_rate>=108 and max_heart_rate<=131 THEN max_hear_rate_cod= "2"; IF max_heart_rate>=132 and max_heart_rate<=155 THEN max_hear_rate_cod= "3"; IF max_heart_rate>=156 and max_heart_rate<=179 THEN max_hear_rate_cod= "4"; ELSE max_hear_rate_cod="5"; Transformation of variable Maximum Heart Rate into classes of Maximum Heart Rate Variable Transformation (Source: Author Based) Table 8 - Variable Transformation (Source: Author Based) 56 3.4.5. Data Partition As part of the data preparation process, it is important to avoid the model overfitting. For that, the primary dataset is divided into a training and validation datasets. The first one covers 70% of the data, and the second one covers 30%. Since there are only 299 observations after the outlier removal, it was decided to not include any data in a test dataset. To divide the dataset, the Data Partition node is used generating the following observations (table 9): D ATASET P ERCENTAGE NUMBER OF O BSERVATIONS TRAINING 70% 209 VALIDATION 30% 90 TEST 0% 0 Data Partition Values Description (Source: Author based) By looking at the results of Data Partition node (figure 23), it is assured that the original dataset is split into a training and validation datasets. The training data is used towards the learning and fitting of the model, so within SAS Miner it is defined a percentage for each target value that is in proportion with the original dataset, and where the stratified method is used for the partitioning. The same will be applied to the validation dataset, that will be used to evaluate the model’s appropriacy in the Model Comparison node, and will allow in a future step to compare the accomplishment of the different models, and to choose the best one. Figure 23 - Summary Statistics for Class Targets (Source: SAS Miner Output, 2020) Tab le 9 - Data Partition Values Description (Source: Author based) 63 The variables selected by the forward and stepwise regression nodes were almost the same, except for one variable, “oldpeak”, that was added and then removed in the stepwise node. For the backward regression node, there were eliminated seven variables: “max_heart_rate_cod”, “blood_sugar”, “resting_blood_pressure”, “age_cod”, “cholesterol_cod”, “electrocardiographic_results”, “oldpeak”. 3.6.3. Decision Tree The third predictive model used is the Decision Tree, which is based on a group of Boolean branch rules that test different facts and construct different link paths in a hierarchical way to determine conclusions, such as the class of a specific instance. The DT used has a combination of (2,6) that represents the maximum branch and depth, respectively. The maximum branch represents the split between the branches, and the maximum depth refers to the maximum growth of the tree in the vertical. This type of model has an easy interpretation, and the most important variables appear at the most top of the tree (Appendix 4). Table 15 - Stepwise Regression Results (Source: SAS Miner Output, 2020) Table 16 - Backward Regression Results (Source: SAS Miner Output , 2020 ) 64 3.6.4. Ensemble The final applied model is the Ensemble. This methodology, as referred before, is used to combine different classifiers, at least 2 or more, so that a new model with a more robust prediction and accuracy is created (Maldonado, Dean, Czika & Haller, 2014). In this case, it was used a selection method named “average value” for interval variables, and another one named “voting” for class variables. The models that were chosen for the Ensemble node were based on two metrics: the ROC Index, which should have the highest value, and the Misclassification Rate, which should have the lowest value. By looking for the validation ROC Index values, the best top two models were the ANN1 and Forward Regression, with the values 0.893 and 0.89, respectively. For the valid Misclassification Rate the best top two were ANN5 and ANN1, with the values of 0.14 and 0.16, respectively. After selecting them, this approach is concluded by selecting the three models for the ensemble node, which are ANN1, ANN5 and Forward Regression. 65 4. ASSESSMENT: RESULTS AND DISCUSSION After the definition of the necessary steps to develop a project about predictive modelling and its successful application, it is necessary to look at the results. In this chapter, there are presented the results of the practical part of the project, the predictive power of the algorithms used, and the comparison and final choice of the best model, which aims to meet the initial problem and show a good performance on predicting whether a person develops a heart attack or not. 4.1. MODEL COMPARISON Having the different algorithms applied, Model Comparison is the final step where the purpose is to determine which model has the best performance while predicting, by applying the Model Comparison node. The analysis and final choice may be based on different metrics such as the ROC curve, Misclassification Rate, Lift, Gain, Akaike Criteria, Bayesian Criteria and Kolmogorov-Smirnov (Dean, 2014). For this project, two metrics were used for the model selection: the (1) ROC Curve and the (2) Misclassification Rate. The first one stands for Receiver Operating Characteristics Curve and displays graphically two axes that range from 0 to 1: the Y axis, that represents the sensitivity or TPR, and the X axis that represents the 1 – specificity or FPR. Those delimit the dispersion of test value points in a bi-dimensional chart, along with the representation of the ROC curve between the X and Y axes. The AUC, Area Under the Curve, is considered an efficient method to measure the sensitivity and specificity, and to assess the test validity (Indrayan & Kumar, 2011). The AUC resumes the ROC curve position, and hence the best model, being used for binary classification problems. The curve that is most located to the upper left side will be the one with the best capacity to differentiate and diagnose tests. For instance, in figure 26 it is shown that test B has a better capacity to discriminate when compared to test A, as it is the closest to the upper left corner (Tilaki, 2013). Figure 26 – Example of two diagnostic tests: ROC Curves from Test A and Test B. Adapted from Receiver Operating Characteristic (ROC) Curve Analysis for Medical Diagnostic Test Evaluation, by K.H. Tilaki, 2013, Retrieved from: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3755824. Copyright 2013 by K.H. Tilaki. 66 A maximum AUC, meaning it is equal to 1, indicates the diagnostic test is ideal when differentiating some subjects, such as disease and non-disease topics, as a value adjacent to 1 reflects a greater test performance. On the other hand, the minimum AUC value is pondered 0.5 because a value of 0 means it tests incorrectly all objects: the ones with disease will be classified as negative, and the non-disease will be classified as positive. The final goal is that the chosen model reflects the greatest area under the ROC curve (Indrayan & Kumar, 2011). During the last forty years, the analysis of the ROC curve became a well-liked approach to examine and evaluate the accuracy of medical systems used in healthcare, which is considered an appropriate metric to be used in this project. The estimation of a specific test accuracy, like the AUC, influences its capacity to differentiate specific cases, such as diseased and non-disease citizens (Tilaki, 2013), as it estimates the quality of the model’s predictions within different limits. The general meaning of AUC refers to the probability of a true positive being precisely classified, as well as with a true negative, being correctly classified as negative (Mysiak, 2020). From the output of Model Comparison node, it is seen the ROC Curves of the different tested models in the ROC Chart, where each curve represents a different classifier (figure 27). Once there are used different predictive models, a graphical analysis may become too complex. An alternative consists of using directly the ROC Index which represents the AUC. For this, the model with the highest index will be the one with the best performance, as curves that are on the most top left side corner represent better models. The higher the degree of concavity, the higher the AUC will be, and the better the model performance is expected to be. Figure 27 - ROC Chart Model's Output (Source: SAS Miner Output, 2020) 67 Table 17 summarizes the ROC Index values of the used models, both for training and validation: MODEL TRAIN: ROC INDEX VALID: ROC INDEX ANN 5 0.996 0.887 ANN 1 0.923 0.893 Ensemble 0.98 0.888 Regression - Stepwise 0.912 0.873 Regression - Backward 0.912 0.873 ANN 3 0.987 0.871 ANN 7 0.989 0.862 Regression – Forward 0.917 0.89 Decision Tree 0.903 0.849 ANN 6 0.999 0.877 ANN 2 0.9 55 0.84 AN N 4 0.9 95 0.8 58 ROC Index was the first metric used, but it is also important to accompany it and complement the analysis with another one. The second metric referred and used for the choice of the best model is the Misclassification Rate, which represents the total of false positives and negatives classified in the total of instances. This metric is used to measure the effectiveness of a DM model, and it is interpreted as the percentage of training and testing examples misclassified from a given dataset (Baughman & Liu, 2014). The goal is that the best model achieves the minimum possible value for this statistic, as it will indicate that the obtained model is accurate (Khoshgoftaar, Yuan, & Allen, 2000). In fact, if the value of this statistic is high, in general the generated model is not useful, and the predictions will be inefficient. The Misclassification Rate values for the training and validation sets are detailed in table 18: Table 17 – ROC Index Performance of Used Models (Source: SAS Miner Output, 2020) 68 M ODEL T RAIN : M ISCLASSIFICATION RATE V ALID : M ISCLASSIFICATION RATE ANN 5 0.0191 0.1444 ANN 1 0.1340 0.1556 Ensemble 0.0813 0.1667 Regression - Stepwise 0.1914 0.1667 Regression - Backward 0.1914 0.1667 ANN 3 0.0526 0.1667 ANN 7 0.0478 0.1667 Regression - Forward 0. 1770 0. 1778 Decision Tree 0 .1579 0. 1889 ANN 6 0.0048 0.1889 ANN 2 0.0813 0.1889 ANN 4 0.0191 0.2 4.2. CHOICE OF THE BEST MODEL After the modulation process is done, and having the selected metrics defined and their values compared, it is required the choice of the model with the best results. As covered before, a good model will have a high ROC Index value, which corresponds to a bigger area under the curve, and a low value for the Misclassification Rate, representing low misclassified training and testing examples. Having this in mind, the best model chose is the Artificial Neural Network with five hidden units (ANN5), with a ROC Index value of 0.996 for the train and 0.887 for the validation (table 17). For the Misclassification Rate, ANN5 shows a value of 0.0191 for the train and 0.1444 for the validation, the lowest of all models (table 18). Hence, within all the tested models, ANN5 becomes the model that will lead to more satisfactory results and with a better predictive performance for the problem in question. Table 18 – Misclassification Values of Used Models (Source: SAS Miner Output, 2020) 69 For the development of the practical part of the project and to reach the final results, different steps were followed, starting by the dataset analysis, continuing with data pre-processing steps, and then, applying the modelling phase with a total of twelve predictive models that were tested: seven different types of Artificial Neural Networks, one Decision Tree, three different types of Logistic Regression and one Ensemble. At the modulation step, it was decided to use for each model all the total thirteen independent variables of the transformed dataset: “thal”, “chest_pain”, “nr_major_vessels”, “oldpeak”, “slope”, “exe_induced_angina”, “age_cod”, “sex”, “max_heart_rate_cod”, “resting_blood_pressure”, “electrocardiographic_results”, “cholestoral_cod” and “blood_sugar”. After the variable analysis and the application of the models, it is possible to understand and conclude which variables most contribute for the prediction of heart attacks. From a group of thirteen predictors, six of them stood out, which are “thal”, “chest_pain”, “nr_major_vessels”, “oldpeak”, “slope”, and “exe_induced_agina”. This choice is due to their high worth from the analysis of StatExplore node, which translates on the meaning and contribution they have on defining the target; to their R-Square values from the Variable Selection node where some variables are rejected and others accepted; to the exploration of the Pearson Correlation values, and finally, due to the variable selection in the Forward, Stepwise and Backward Regression nodes. Despite the identified correlations, some variables were opted to keep as their correlation values were under 0.8 and they did not add redundancy to the model. Regarding the results of the remaining applied models, it was also analysed their contribution: it is shown that ANN2 and ANN4 are the models with the lowest performance: ANN2 has the lowest valid ROC Index, 0.84, and the second highest valid Misclassification rate, 0.1889. The ANN4 has the highest valid Misclassification Rate, 0.2, and a valid ROC Index of 0.858, one of the lowest. After ANN5, the best second model is ANN1 with a valid Misclassification Rate of 0.1556 and a valid ROC Index of 0.893. The Stepwise, Backward and Forward Regression showed to give better results than the Decision Tree: the first two have the same values of 0.1667 for the valid Misclassification Rate and 0.873 for valid ROC Index, and the Forward Regression has 0.1778 for the valid Misclassification Rate and 0.89 for valid ROC Index. For the decision tree, the model shows a value of 0.1889 and 0.849, respectively. Considering the ensemble that was formed with ANN1, ANN5, and Forward Regression, it showed to give better results (valid Misclassification Rate of 0.1667 and a valid ROC Index of 0.888) than the remaining models, which include most of the Artificial Neural Networks, the Decision Tree, and the three Regressions. In general, most of the models showed satisfactory results having valid ROC Indexes equal or higher than 0.84, and Misclassification Rates mostly lower than 0.2. 70 5. CONCLUSIONS The use of Data Mining is valuable and extremely important on different fields, from business management, to healthcare, and preventive medicine, as it gives a great contribution for the analysis of high volumes of data, for the discovery of important relationships and patterns, for the understanding of the impact that objects and variables have, and for the support of important decisions that may change people’s lives. Considering the numbers of heart attacks happening nowadays and worldwide deaths, it is of great interest and importance to make use of Information Technology, Data Mining, Machine Learning techniques, and methodologies, to improve the knowledge that doctors and medical staff have about these diseases, in order to detect at early stages symptoms of possible complications or diseases that might happen on patients, so future problems can be warned and prevented, and in more serious cases, new deaths. The present work is based on a real dataset retrieved from UCI Machine Learning Repository, being composed by 303 records that represent significant health indicators, the predictors, used for the analysis of the target, which is the occurrence of heart attacks. The project has different parts and consists of analysing the dataset and using DM algorithms to create and develop predictive models that can predict whose patients may develop heart attacks in the future, and posteriorly, helping on the prevention of this serious problem in real life situations. In the literature review it is possible to understand the general overview about the DM meaning, its applications, and its types of algorithms, as well as its use in the healthcare sector, medicine, and on the project’s topic – occurrence of heart attacks. In this topic and within the chapter, there are explored some studies that already support the developments done with DM and technologies over the years in healthcare and medicine field, mainly on the prediction of serious diseases, such as cancer, diabetes, and on the project’s case, cardiovascular diseases. The development of the theoretical part is proceeded by the practical one that was done in different phases: the understanding of the problem, mainly done with different types of literature and the understanding of the heart disease topic, followed by data analysis, data pre-processing techniques, implementation of the predictive models, the analysis of their results, and final conclusions. These steps were done with the help of software SAS Enterprise Miner 15.1, which allowed the transformation of variables and the dataset cleaning, and in a next phase, the implementation of the modulation process where different algorithms were applied for the prediction of heart attacks. For this project, it was opted to use seven types of Artificial Neural Networks, one Decision Tree, three different types of Logistic Regression, and one Ensemble, so that different models, complexities, and performances could be tested. 71 Lastly, the models’ results were assessed and compared, mainly using two metrics: the ROC Curve (ROC Index) and the Misclassification Rate. From a technical point of view, the model with the best metric values, and hence with the best predictive performance was chose, being the Artificial Neural Network with 5 hidden units the final choice. Having the variables analysed, the models compared, and the final decision, it was also possible to identify and conclude which variables most contribute for the occurrence of heart attacks, due to the statistical analysis. The final group is composed by six variables that represent important values or indicator levels of a patient’s health, and those are: (1) Thalassemia (Thal), which is a genetic blood disorder responsible for the lower levels of haemoglobin in the body, influencing the way the red cells carry oxygen throughout the body and the functioning of the system, which may cause fatigue and weakness; (2) Chest pain, which is labelled with distinct values regarding the level of pain. Those are 0- Typical angina, 1- Atypical angina, 2- Non-anginal pain and 3- Asymptomatic pain; (3) the Number of Major Vessels coloured by the method of fluoroscopy, which is a procedure done in cardiac catheterization that aims to see the flow of blood through the coronary arteries, and to check for eventual arterial blockages; (4) the Oldpeak, which is the continuous value for ST depression in the treadmill electrocardiogram, caused by exercise related to rest; (5) Slope, meaning the peak exercise in ST segment and that can be classified in upsloping, flat sloping or down sloping; and finally, (6) if the exercise induced angina, which is a typical pain in the chest originated by the low circulation of the blood to the heart. Different studies have shown a number of factors that may enlarge the risk of developing heart attacks, mainly the family history of cardiovascular diseases, the existence of a high fat diet, obesity, lack of exercise, hypertension, cholesterol, (Kumari & Godara 2011), chest pain type, feature of the body vessels, blood pressure and other severe illness (Alzahani et al., 2014). These and other external factors are important for the analysis and influence of cardiovascular diseases, and they are also supported in the literature review. It is assured that the prevention of these diseases starts in the self-conscious of each individual by modifying one’s lifestyle to a healthier one, mainly with a better stress management and physical activity, which will eventually contribute to the reduction of obesity and hypertension, and consequently, to lower the risk of cardiovascular diseases (Mohsenipouya, Majlessi, Shojaeizadeh, Foroushani, Ghafari, Habibi, & Makrani, 2016). Nevertheless, the use and study of the specific group of variables applied in this project allowed to understand which ones most contribute for heart attacks despite the other external factors. As referred before, these variables are important predictors that reflect the status of a patient’s health, and consequently, by understanding their worth and impact for the problem in question, it is possible to make easier predictions about the occurrence of the problem based on their values. From a total of thirteen variables of the dataset, six of them showed to have more importance, thereby, looking for symptoms of thalassemia, possible chest pains, several major vessels coloured by fluoroscopy method, 72 possible angina pains caused by exercise, and examining the values of ST depression and slope, are ways of preventing and predicting heart attacks. This final group of predictors are previously described, and they are also supported and explored by other studies on the field. For instance, in one case it was proposed an interpretable fuzzy rule-based system that could predict the CAD only based on the age, the levels of angina caused by exercise, the group of major vessels coloured by the fluoroscopy method, the thallium stress results and the slope, which showed to be promising to diagnose CAD and a credible system to be administered as a support for diagnostic decisions. Another diagnosis for CAD was made by examining the stenosis of each vessel separately, where chest pain, angina and ST elevation/depression were some of the biggest factors for the stenosis of the LAD vessel (Alizadehsani et al., 2012). It is also registered that the coronary artery stenosis has a remarkable relationship with abnormal levels of cholesterol, hypertension, and stress caused by exercise (Mohsenipouya et al., 2016). Not only the awareness for these variables and factors is important, but also, alerting for the problem with educational interventions is also critical to change the consciousness of the individuals with risk of having cardiovascular diseases. It is indispensable that each one gains responsibility for his/her health, and that people focus on the benefits of physical activity, on a healthy lifestyle, and on the importance of stress levels management. Therefore, it is a top priority to develop and implement educational programs focusing on health, in order to raise awareness for the literacy and knowledge that people have on diseases and their risks, and to influence and inspire them on the adoption of a healthy lifestyle (Mohsenipouya et al., 2016). Although the results of the models covered in the literature review studies and in this project do not have 100% of performance, they have shown that DM techniques are strongly encouraging and achieve promising results (showing high classification accuracies of at least 77% or higher) that can be positively used to complement and assist people while using heart disease prediction systems, which will enable more efficient and corrected medical decisions, early diagnosis, and more suitable treatments. The number of records of the dataset is small, nevertheless, resorting to these DM techniques on the sample of people used in this project has shown to have a good predictive capacity, which enables the establishment of patterns and profiles on patients, for instance, the long-term evaluation of their chest pain, blood pressure or other indicators, that should be under control. This capacity applied to higher volumes of medicine data and the use of DM methods will have a direct influence on the analysis of the patients’ health, which may indicate at an early stage if a person is at risk of developing an heart attack. These approaches would allow medical innovation, early action and quicker answers, more life quality for patients, and the reduction on the number of deaths due to heart attacks. 79 Sondwale, P. P. (2015). Overview of predictive and descriptive data mining techniques. International Journal of Advanced Research in Computer Science and Software Engineering, 5(4), 262-265. Srinivas, K., Rani, B. K., & Govrdhan, A. (2010). Applications of data mining techniques in healthcare and prediction of heart attacks. International Journal on Computer Science and Engineering (IJCSE), 2(02), 250-255. Srinivas, K., Rao, G. R., & Govardhan, A. (2010). Analysis of coronary heart disease and prediction of heart attack in coal mining regions using data mining techniques. In 2010 5th International Conference on Computer Science & Education (pp. 1344-1349). Srivastava, A. N., & Han, J. (Eds.). (2016). Machine learning and knowledge discovery for engineering systems health management. CRC Press. Tang, P. H. & Tseng, M. H. (2009, July). Medical data mining using BGA and RGA for weighting of features in fuzzy k-NN classification. In 2009 International Conference on Machine Learning and Cybernetics (Vol. 5, pp. 3070-3075). IEEE. Tilaki, K. (2013). Receiver operating characteristic (ROC) curve analysis for medical diagnostic test evaluation. Caspian journal of internal medicine, 4(2), 627. Timofeev, R. (2004). Classification and regression trees (CART) theory and applications. Humboldt University, Berlin, 1-40. Tripepi, G., Jager, K. J., Dekker, F. W., & Zoccali, C. (2008). Linear and logistic regression analysis. Kidney international, 73(7), 806-810. Ujjwalkarn (2016). A quick introduction to artificial neural networks. [online] In The data science blog. Retrieved February 17, 2020, from: https://ujjwalkarn.me/2016/08/09/quick-intro-neural-networks/. Wang, H., & Raj, B. (2017). On the origin of deep learning. arXiv preprint arXiv:1702.07800. Wang, Q. R., & Suen, C. Y. (1984). Analysis and design of a decision tree based on entropy reduction and its application to large character set recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, (4), 406-417. Wasan, S. K., Bhatnagar, V., & Kaur, H. (2006). The impact of data mining techniques on medical diagnostics. Data Science Journal, 5, 119-126. Wilkins, E., Wilson, L., Wickramasinghe, K., Bhatnagar, P., Leal, J., Luengo-Fernandez, R., ... & Townsend, N. (2017). European cardiovascular disease statistics 2017. Winters-Miner, L. A. (2014). Seven ways predictive analytics can improve healthcare. [online] In Elsevier Connect. Retrieved February 17, 2020, from: https://www.elsevier.com/connect/seven-ways- predictive-analytics-can-improve-healthcare?aaref=. Witten, I. H., & Frank, E. (2002). Data mining: practical machine learning tools and techniques with Java implementations. Acm Sigmod Record, 31(1), 76-77. Xing, Y., Wang, J., & Zhao, Z. (2007). Combination data mining methods with new medical data to predicting outcome of coronary heart disease. In 2007 International Conference on Convergence Information Technology (ICCIT 2007) (pp. 868-872). IEEE. Xue, W., Sun, Y., & Lu, Y. (2006). Research and application of data mining in traditional Chinese medical clinic diagnosis. In 2006 8th international Conference on Signal Processing (Vol. 4). IEEE. 80 Yumusak, N. & Temurtas, F. (2010). Chest diseases diagnosis using artificial neural networks. Expert Systems with Applications, 37(12), 7648-7655. Ziegler, A., & König, I. R. (2014). Mining data with random forests: current options for real-world applications. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 4(1), 55-63. Zhang, G., Patuwo, B. E., Hu, M. Y. (1998). Forecasting with artificial neural networks: The state of the art. International Journal of Forecasting, 14(1), 35–62. 1 8. APPENDIX  Appendix 1: SAS Enterprise Miner Project Diagram 1  Appendix 2: Treatment of Outliers 1  Appendix 3: Correlation Matrix Results – Pearson Correlation 1  Appendix 4: Decision Tree Model 1