Journal of Cognitive Human-Computer Interaction

Application of SAFARI in Prediction of Heart Disease

Irfan Rajab Bhat, M. Arif Wani
Volume 7, Issue 2, pp. 01–04 (2024)
DOI: https://doi.org/10.54216/JCHCI.070201
Online: https://americaspg.com/journal/25/article/2660

Abstract

Cardiovascular disease has been the major cause of mortality worldwide for last several decades. Diagnosis of heart disease through traditional approaches is a complex, time consuming and error prone process. To address this issue, several techniques have been proposed to automate the process of diagnosing the heart disease accurately in timely manner. However these techniques report limited accuracy of diagnosing the disease. In this paper SAFARI algorithm is used to diagnose the heart disease. Safari uses rule based approach i.e. it extracts rules from a dataset and uses the extracted rules for diagnosis. The various attribute values are first discretised into specific ranges, each range corresponds to a symbol. This results in a symbol table. Safari extracts rules from this symbol table. The approach has been thoroughly tested on the heart disease dataset publicly available on UCI machine learning repository. The results obtained using this approach are compared with the results of various techniques reported by other authors, a significant improvement was observed.

Keywords: Safari; Discretization; Rule induction; Decision tree; Symbols

1. INTRODUCTION

Cardiovascular disease is the major cause of death in the world according to the World Health Organisation. Some parameters that indicate heart disease in an individual are cholesterol levels, blood pressure, heart rate, and related clinical measurements. It is important that heart disease be diagnosed at earlier stages so that proper treatment is prescribed to patients and the effect of the disease is reduced as much as possible. Timely detection of heart disease plays a pivotal role in effective prevention and timely intervention strategies. With advancements in machine learning techniques, particularly decision-tree algorithms, there has been growing interest in leveraging these methods for predictive analytics in the medical domain. Decision trees offer interpretability, ease of implementation, and the ability to handle complex datasets, making them suitable candidates for heart disease prediction models.

Traditionally, investigations are carried out by medical professionals to diagnose heart disease in patients, and this process can be augmented using AI technology. The approach of inductive learning has been explored over multiple problem domains with the aim of extracting rules from datasets [1]. The implementation of machine learning algorithms directly on clinical data has also been employed to detect heart disease [2]. Data mining technology has been found very useful, especially in healthcare, because it extracts hidden patterns from available data and transforms them into meaningful information that helps optimise decisions [3]. Researchers have tried using AI technology to detect heart disease in patients at the earliest stage [4]. These techniques include various machine learning algorithms that use large amounts of healthcare data and transform them into meaningful data for decision support [5].

Heart disease prediction methods that use machine learning include models implementing regression [6], multilayer perceptrons [7], modified K-means and ID3 algorithms [8], integration of random forest with a linear model [9], and ensembles of multiple neural networks [10]. Clinical decision support systems have also been investigated by researchers, improving the performance of heart disease diagnosis [11]. However, there remains scope to improve the performance of heart disease prediction with higher accuracy.

In this paper, we use the SAFARI algorithm to improve the accuracy of heart disease prediction. SAFARI is a decisiontree-based approach, which is discussed in Section 3. The rest of the paper is structured as follows: Section 2 discusses related work; Section 3 presents the methodology of the proposed algorithm; Section 4 presents the results and discussion; and Section 5 concludes the paper.

Previous research efforts have explored various machine learning techniques for heart disease prediction, aiming to improve accuracy and clinical applicability. Decision-tree algorithms, in particular, have been widely studied and compared with other predictive models in the context of cardiovascular risk assessment. Anooj [5] developed a system to predict heart disease using a fuzzy weighted approach. It consists of two phases: formulation of weighted fuzzy rules and development of a system based on those fuzzy rules. The performance of the proposed system was compared with a neural-network-based system, and improved performance was observed.

Heart disease prediction using regression models was proposed by Zhang et al. [6]. Their study predicts the probability of disease occurrence based on risk factors such as age, sex, and chest pain. The system uses preprocessing and feature selection on a UCI machine learning repository dataset containing 303 samples. The accuracy achieved by this system was 84.98%. The problem associated with this approach is that regression is sensitive to extreme values, which can lead to under-fitting and low accuracy.

Prediction of heart disease using a multilayer perceptron network was proposed by Sonawane and Patil [7]. The system consists of two steps. In the first step, 13 clinical attributes are given as input, and then the network is trained using a back-propagation algorithm. The performance of the system was evaluated on the Cleveland heart disease database from the UCI repository. This database contains 303 records; 70% of the data was used for training and the remaining 30% was used for testing. The accuracy achieved using this technique was 93.39%.

Heart disease prediction using modified K-means and ID3 algorithms on big data was proposed by Mane [8]. The system used a modified K-means algorithm for clustering and the ID3 algorithm for building the decision tree. The modified K-means algorithm classifies the dataset into applicable clusters without taking the number of clusters as input. In this system, the database is first loaded and the two algorithms are applied. The output of these algorithms is the predicted heart disease. The achieved accuracy varied with record size: 95.7% for 3000 records, 98.18% for 5000 records, and 94.91% for 10000 records.

Mohan et al. [9] developed a heart disease prediction system that employed hybrid machine learning approaches and provided a substitute approach for feature selection to make training and testing effective. This system combines random forest with a linear method. The process starts with data preprocessing, followed by feature selection based on decision-tree entropy, and then classification and modelling performance evaluation. The accuracy achieved with this approach was 88%.

Fitriyani et al. [12] proposed a heart disease prediction method to provide an efficient mechanism for prediction in the presence or absence of disease, given various parameters. The datasets used were Statlog and Cleveland. Preprocessing, including data transformation and feature selection, was performed. Data balancing was performed using the SMOTE-ENN technique to balance the training dataset. XGBoost-based machine learning was then used to learn from the training dataset and generate the heart disease prediction model. The accuracy achieved using this approach was 95% for Statlog and 98% for Cleveland.

Diagnosis of heart disease through an ensemble of neural networks was proposed by Das et al. [10]. The proposed method created a new model by combining probabilities from multiple predecessor models. Partitioning of data was performed to split the input data into training and validation datasets. An ensemble approach was used to create new models by combining predicted values from preceding models. The accuracy of the model was 89%. Although many researchers have proposed different ways to predict heart disease, there is still a need for a heart disease prediction system that can improve accuracy.

3. PROPOSED ALGORITHM

The proposed method in this paper uses the SAFARI algorithm [1] to predict heart disease. SAFARI constructs a decision tree for the dataset and extracts rules from it in two steps: discretization of attributes and formation of the decision tree.

3.1 Discretization of Attributes

The continuous values of an attribute are first converted into discrete values. Each discrete value of an attribute is called a symbol. Each symbol of an attribute contains a range of values associated with it.

Discretizing an attribute involves the following steps. First, attribute values are arranged in ascending order, and the threshold value is found as

M ∑ i=2 threshold = 1 M −1

(vali −vali−1), (1)

where M is the number of attribute values and vali is the ith attribute value.

Second, the disorder value is found using the initial threshold value as

Disorderm = 1−quantizationm, (2) where quantizationm = 1 ∑(MLPij ×SIGij). (3)

The maximum local probability is given as

n(ij)k

 , k = 1,2,..., p, (4) nij

MLPij = max where nij is the number of examples containing symbol sij, and n(ij)k is the number of examples containing symbol sij belonging to class k. The significance of a symbol is given as

n(i j)k

 , (5) Nk

SIGi j = max where Nk is the number of examples belonging to class k.

The disorder computation is repeated with values close to the initial threshold value, and the value that minimises the disorder measure is selected as the threshold. Quantization levels are then obtained as follows: arrange attribute values in increasing order; assign the next higher quantization level to an attribute value if the difference between it and the one immediately below it exceeds the threshold; merge two consecutive quantization levels if they cover examples of the same class; and repeat the merge step until no more merging is possible. After the final merge operation, each range of an attribute corresponds to a symbol of that attribute, denoted by si j.

3.2 Formation of Decision Tree

SAFARI uses a decision-tree-based approach for obtaining rules, but unlike other tree-based algorithms, it allows more than one attribute at a node. The algorithm is applicable to examples involving attributes with both continuous and discrete values. It produces a separate decision tree for each class.

Decision tree formation in SAFARI involves the following steps:

1. Let E be the set of all examples in the dataset.

2. Calculate α1 and α2. If the number of examples is 1 to 10, then α1 = 10 and α2 = 10α1. If the number is 11 to 100, then α1 = 100 and α2 = 100α1. If the number is 101 to 1000, then α1 = 1000 and α2 = 1000α1.

3. For each symbol, calculate Ng(i j)P and Ng(i j), where Ng(ij)P is the number of examples in E that contain symbol sij and belong to class P, and Ng(i j) is the number of examples in E that contain symbol si j.

4. At the root node, set E1 = E.

5. Let N1 be the number of examples in E1.

6. For each symbol, calculate N(i j)P and N(i j) using E1, where N(ij)P is the number of examples in E1 that contain symbol sij and belong to class P, and N(i j) is the number of examples in E1 that contain symbol si j.

7. For each symbol, calculate

! !  + + . (6) α1 α2 N1

N(ij)P

N(i j)

Ng(i j)P

Fij =

N(ij)

Ng(i j)

8. Select the best symbols that cover all examples of E1 belonging to the class under consideration. The best symbol is the one for which Fi j is maximum.

9. Remove subset symbols, if any.

10. Branch out on each selected symbol.

11. Associate with each branch a set E1 = E1 −branchk. If E1 covers examples of more than one class, then go to Step 5; otherwise, terminate the current branch with a leaf node.

Figure

No Figure 1. SAFARI workflow.

4. RESULTS AND DISCUSSION

4.1 Dataset Used

The dataset is taken from the UCI repository and consists of 303 samples with 14 attributes. Each attribute is a parameter based on which disease in a patient is diagnosed. This dataset is a collection of records of various patients including age, sex, chest pain, blood pressure, cholesterol, blood sugar, and other clinical features. The dataset is processed using Python libraries such as NumPy and Pandas.

Table 1. Dataset attributes
Table 1. Dataset attributes

Attribute Meaning Age Specifies age of patient; continuous Sex Gender of patient CP Chest pain type trestbps Resting blood pressure results; continuous Chol Cholesterol level fbs Fasting blood sugar restecg Electrocardiograph result thalach Maximum heart rate achieved exang Angina due to exercise oldpeak ST depression slope ST segment slope ca Number of vessels thal 1 is normal, 2 is fixed defect, 3 is reversible defect

The attributes of the dataset are first converted to discrete form. Different ranges of an attribute in the dataset correspond to different symbols of that attribute. This resulted in a symbol table, which was given as input to the algorithm. The algorithm then extracted rules from it.

4.2 Comparison with Other Methods

Using the SAFARI algorithm for heart disease prediction allows comparison with other methods. Prediction of heart disease using a random forest approach was proposed by Pal and Parija [13]; the output was expressed in terms of accuracy, sensitivity, and specificity. The KNN approach uses KNeighborsClassifier on the dataset for the classification task. In this approach, the dataset is first split into training and test sets, and then the value for k is specified. After applying the classifier on the dataset, the model is trained and used to predict the class of the test data.

One method proposed by Mane [8] for prediction of heart disease used two algorithms: improved K-means for clustering and ID3 for classification. In the heart disease prediction system, the database is first loaded, and then K-means and ID3 algorithms are applied for clustering and classification. Input to the algorithm consists of parameters of the dataset.

Table 2. Performance of various decision trees
Table 2. Performance of various decision trees

Algorithm Accuracy C4.5 [14] 76% Random Forest [13] 86.9% CART [15] 87% ID3 [8] 94% SAFARI 100%

Table 2 shows the performance of various decision-tree algorithms used for heart disease prediction. The C4.5 algorithm gives an accuracy of 76%, random forest gives 86.9%, classification and regression tree (CART) gives 87%, and ID3 predicts the disease with an accuracy of 94%. It is clear from these observations that SAFARI produces the most satisfactory result, with a classification accuracy of 100%.

5. CONCLUSION

A new approach for classifying the heart dataset is proposed in this paper, using the SAFARI algorithm. The algorithm extracts rules from the dataset using the steps discussed in Section 3. The algorithm is applicable to both continuous- and discrete-valued attributes. In the case of continuous-valued attributes, the algorithm performs quantization of attribute values, which gives the corresponding discrete ranges. The algorithm also reduces the number of rules for classification. An accuracy of 100% was obtained for the heart disease dataset, and none of the previously used algorithms in the comparison reached that accuracy.

DISCLOSURE STATEMENT

No potential conflict of interest was reported by the author(s).

References

[1] M. A. Wani, “SAFARI: A Structured Approach for Automatic Rule Induction”, IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS, vol-31 August (2001),pp 650- 655.

[2] Chaimaa Boukhatem, Heba Yahia Yousef, Ali Bou Nassif, Heart disease prediction using machine learning, Advances in science and Engineering technology International Conference, pp 1-3 (2022),DOI:10.1109/ASET53988.2022.9734880

[3] Gande Akhila,Hemachandran K,Juan R Jaramillo. "Indian Premier League Using Different Aspects of Machine Learning Algorithms." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 1, 2021 ,PP. 01-07.

[4] A.F.Oroom, E.E.Abdallah, Y.Kilawi, A.Kafaye and M.Ashour, “Effective diagnosis and monitoring of heart disease”, International journal of software engineering and its application (2015), pp 143-146.

[5] Madhumita Pal, Smita Parija Prediction of heart disease using random forest, Journal Of Physics(2021), pp 2-9.

[6] Ashok Kumar M ,Abirami A,Sindhu P,Ashok Kumar V D ,Rani V. "Modern Medical Innovation on the Preferred Information about the Medicine using AI Technique." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 1, 2021 ,PP. 8-17.

[7] P.K.Anooj “Clinical decision support system: Risk level prediction of heart disease using weighted fuzzy rules”, Journal of King Saud University-Computer and Information sciences,(2011), pp 27-38.

[8] Heart disease identification using Machine learning classification in E-health care ,IEEE Access, pp 107562-107565.

[9] Shruti patil, Mrunal Annadate, Implementation of machine learning model to predict heart problem, International Journal of Recent Technology and engineering(IJRTE), volume-10, pp 117-118.

[10] Mrs.K.Kiruthika,Ms.S.Gayathri,Ms.R.Hemalatha,Ms.P.Menaga. "Design and Development of Mobile Healthcare Application for “Ayurvedic” based Clinical Documents." Journal of Cognitive Human- Computer Interaction, Vol. 1, No. 1, 2021 ,PP. 18-27.

[11] Yingjie Zhang, Lijuan Diao, Linlin Ma ,”Logistic Regression Models in Predicting Heart Disease”, Journal of Physics : Conf. Series,2021, pp 1-4.

[12] Jayshril S. Sonawane, D.R.Patil, “Prediction of heart disease using multilayer perceptron neural network”, international Conference on Information Communication and Embedded Systems,(2014), pp 1-4.

[13] Ajay G,Abhishek Kumar,Venkatesan R. "Query-Based Image Retrieval using Support Vector Machine (SVM)." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 1, 2021 ,PP. 28-36

[14] Ms. Tejaswini U. Mane “Smart heart disease prediction system using Improved K-Means and ID”, International Conference on Data Management, Analytics and Innovation (ICDMAI),(2017), pp 241-242.

[15] S. Mohan, C. Thirumalai, Gautam Srivastav, Effective heart disease prediction using hybrid machine learning techniques, IEEE Access(2017), pp 2-9.

[16] Norma Latif Fitriyani ,Muhammad Syafrudin ,Ganjar Alfian HDPM: An Effective Heart Disease Prediction Model for a Clinical Decision Support System,2020, IEEE Access, pp- 133034-133036.

[17] N. C. Long, P. Meesad, and H. Unger, ‘‘A highly accurate firefly based algorithm for heart disease prediction,’’ Expert Syst. Appl., vol. 42, no. 21, pp. 8221–8231, Nov. 2015, doi: 10.1016/j.eswa.2015.06.024.

[18] Resul Das, Ibrahim Turkogla, Abdulkadir sengur Effective diagnosis of heart disease through neural networks ensembles (2009), Department of Informatics, Firat University, 23119 Elazig, Turkey Department of Electronics and Computer Science, Firat University, 23119 Elazig, Turkey, pp- 7677-7678..

[19] L. Verma, S. Srivastava, and P. C. Negi, ‘‘A hybrid data mining model to predict coronary artery disease cases using non-invasive clinical data,’’ J. Med. Syst., vol. 40, no. 7, p. 178, Jul. 2016.

[20] U. Haq, J. P. Li, M. H. Memon, S. Nazir, and R. Sun, ‘‘A hybrid intelligent system framework for the prediction of heart disease using machine learning algorithms,’’ Mobile Inf. Syst., vol. 2018, pp. 1–21, Dec. 2018.

[21] S. M. Saqlain, M. Sher, F. A. Shah, I. Khan, M. U. Ashraf, M. Awais, and A. Ghani, ‘‘Fisher score and matthews correlation coefficient-based feature subset selection for heart disease diagnosis using support vector machines,’’ Knowl. Inf. Syst., vol. 58, no. 1, pp. 139–167, Jan. 2019.

[22] Gupta, R. Kumar, H. S. Arora, and B. Raman, ‘‘MIFH: A machine intelligence framework for heart disease diagnosis,’’ IEEE Access (2020), vol. 8, pp. 14659–14674.

[23] Likitha KN, Nethravathi R, Nithyashree K, Ritika Kumari, Sridhar N, Venkateswaran K, Heart Disease Detection using Machine Learning Technique, IEEE Explore.

[24] K. B. Nahato, K. N. Harichandran, and K. Arputharaj, ‘‘Knowledge mining from clinical datasets using rough sets and back propagation neural network,’’ Comput. Math. Methods Med., vol. 2015, pp. 1–13, Mar. 2015.

[25] Mert Ozcan, Serhat Peker, “ A classification and regression tree algorithm for heart disease modeling and prediction”, ELSEVIER, pp 1-6, December 2022,doi:10.1016/j.health.2022.100130.

[26] Srabanti Maji, Srishti Arora, “Decision tree algorithms for prediction of heart disease”(2019) , Springer, pp 451-452, doi:10.1007/978-981-13-0586-3_45.