Heart Disease Prediction Using Optimized Weighted K-Nearest Neighbor (WKNN)
DOI:
10.29303/jppipa.v10i11.9257Published:
2024-11-30Issue:
Vol. 10 No. 11 (2024): NovemberKeywords:
Euclidean, Gaussian Kernel, Heart Disease, Optimized Weighted K-Nearest NeighborResearch Articles
Downloads
How to Cite
Downloads
Metrics
Abstract
Heart disease remains a significant challenge in the medical field, particularly in predictive diagnostics. This research aims to present a comprehensive investigation into the development and evaluation of a novel approach for heart disease detection using a Weighted k-Nearest Neighbors (WKNN) method. The method employs Euclidean distance metrics and Gaussian kernel weighting for optimal classification results. The research dataset consists of 200 data points, each with 10 key indicators such as age, sex, chest pain type, resting blood pressure, cholesterol levels, fasting blood sugar, resting electrocardiographic results, maximum heart rate achieved, exercise-induced angina, and ST depression relative to rest. Through rigorous experimentation, it is identified that the optimal value of K for classification is 11, with a sigma value of 1.5 for the Gaussian kernel weighting. During the training and evaluation phase, the proposed WKNN method achieved impressive performance metrics, with an accuracy of 91.8%, precision of 93%, and recall of 91%. These findings underscore the potential of the WKNN model as a reliable tool for heart disease detection, showing great promise for practical application in clinical settings. The results emphasize that the proposed method can contribute significantly to improving diagnostic accuracy for heart disease patients
References
Akhiladevi, Anitha, Amrutha, & Chandanashree. (2022). Accident Prediction Using KNN Algorithm. Fourth International Conference on Emerging Research in Electronics, Computer Science and Technology (ICERECT).
Alfyani, R., & Muljono. (2020). Comparison of Naïve Bayes and KNN Algorithms to understand Hepatitis. International Seminar on Application for Technology of Information and Communication (iSemantic), https://doi.org/10.1109/iSemantic50169.2020.9234299.
Ana, B. C., Barbosa, E., Silva, S., Bento, T., Teixeira, A. S., Salgado, J., & Cunha, C. (2016). Client’s immersed and distanced speech and therapist’s interventions in emotion-focused therapy for depression: an intensive analysis of a case study. Research in Psychotherapy: Psychopathology, Process and Outcome, 136-149.
Barwal, R. K., & Raheja, N. (2022). A Classification System for Breast Cancer Prediction using SVOF-KNN method. International Conference on Augmented Intelligence and Sustainable Systems (ICAISS), https://doi.org/10.1109/ICAISS55157.2022.10010736.
Briouza, S., Gritli, H., Khraief, N., Belghith, S., & Singh, D. (2022). EMG Signal Classification for Human Hand Rehabilitation via Two Machine Learning Techniques: KNN and SVM. 5th International Conference on Advanced Systems and Emergent Technologies (IC_ASET), https://doi.org/10.1109/IC_ASET53395.2022.9765856.
Duan, M. (2024). Innovative compressive strength prediction for recycled aggregate/concrete using K nearest neighbors and meta heuristic optimization approaches. Journal of Engineering and Applied Science, 71:15. https://doi.org/10.1186/s44147-023-00348-9.
Guo, S., Guo, L., Zeinolabedin, S., & Mayr, C. (2022). Various Distance Metrics Evaluation on Neural Spike Classification. Biomedical Circuits and Systems Conference (BioCAS).
Halder, R. K., Uddin, M. N., Uddin, M. A., Aryal, S., & Khraisat, A. (2024). Enhancing K nearest neighbor algorithm: a comprehensive review and performance analysis of modifications. Journal of Big Data, 113-168. https://doi.org/10.1186/s40537-024-00973-y.
Hu, B., Li, X., Shuting, S., & Ratcliffe, M. (2018). Attention Recognition in EEG-Based Affective Learning Research Using CFS+KNN Algorithm. IEEE/ACM Transactions on Computational Biology & Bioinformatics, 38-45. https://doi.org/10.1109/TCBB.2016.2616395.
Islami, F., Sumijan, & Defit, S. (2024). Customized Convolutional Neural Network for Glaucoma Detection in Retinal Fundus Images. Journal of Research in Science Education, 10(8), 4606-4613. https://doi.org/10.29303/jppipa.v10i8.7614.
Kalcheva, N., Todorova, M., & Penev, I. (2023). Study of the K-Nearest Neighbors Method with Various Features for Text Classification in Machine Learning. International Conference AUTOMATICS AND INFORMATICS.
Keylabs. (2024, September 13). Keylabs.ai LTD. Retrieved from https://keylabs.ai/blog/k-nearest-neighbors-knn-real-world-applications/
Kiyak, E. O., Ghasemkhani, B., & Birant, D. (2023). High-Level K-Nearest Neighbors (HLKNN): A Supervised Machine Learning Model for Classification Analysis. Electronics, 12(18):3828.
L. Minocha, P. J. (2022). Social Media's Impact on Business and Society: A Study. 8th International Conference on Advanced Computing and Communication Systems (ICACCS).
Lai, H., & Xu, W. (2020). Robust Gaussian kernel based signal detection in the presence of non-Gaussian noise. International Conference on Information, Cybernetics, and Computational Social Systems (ICCSS), https://doi.org/10.1109/BMEI.2011.6098736.
Lei, X., Yan, S., & Zhou, L. (2023). Extensions of local-mean K-nearest neighbor classifier with various distance metrics. International Conference on Power, Intelligent Computing and Systems (ICPICS).
Lei, Z., Zhu, L., Fang, Y., Li, X., & Liu, B. (2020). Anomaly detection of bridge health monitoring data based on KNN algorithm. Journal of Intelligent & Fuzzy Systems 39, 5243–5252. https://doi.org/10.3233/JIFS-189009.
Mladenova, T., & Valova, I. (2022). Comparative analysis between the traditional KNearest Neighbor and Modifications with Weight- Calculation. International Symposium on Multidisciplinary Studies and Innovative Technologies (ISMSIT).
Natarajan, K., Kumar, V. V., Mahesh, T. R., Abbas, M., Kathamuthu, N., Mohan, E., & Annand, J. R. (2024). Efficient Heart Disease Classification Through Stacked Ensemble. International Journal of Computational Intelligence Systems, 170-174. https://doi.org/10.1007/s44196-024-00538-0.
R., G., S. K. B, S., Mathivanan, S. K., Rajadurai, H., Malar, B. A., Mallik, S., & Qin, H. (2024). Enhancing heart disease prediction with reinforcement learning and. Systems and Soft Computing 6, https://doi.org/10.1016/j.sasc.2024.200129.
Saini, I., & Maheshkar, V. (2022). Effects of Distance Metrics on Color Recognition using Color Histogram and KNN Algorithm. Delhi Section Conference (DELCON).
Samad, M. M., Ali, N. M., & Tajuddin, S. N. (2017). Analysis of Distance Metric Variations in KNN for Agarwood Oil Compounds Differentiation. Conference on Systems, Process and Control.
Schneider, K., Loizaga, S. d., Beck, A., Morales, D., Seo, J., & Divanovic, A. (2024). Socioeconomic Influences on Outcomes Following Congenital Heart. Pediatric Cardiology, 1072–1078. https://doi.org/10.1007/s00246-024-03451-7.
Sih-Huei Chen, Jia-Ching Wang, Wen-Chi Hsieh, Yu-Hao Chin, Chin-Wen Ho, & Chung-Hsien Wu. (2016). Speech Emotion Classification Using Multiple Kernel Gaussian Process. Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA).
Siyu, Z., Chongnan, H., Mingjuan, S., & Linna, L. (2021). Two-parameter KNN algorithm and its application in recognition of brand rice. Journal of Intelligent & Fuzzy Systems, https://doi.org/10.3233/JIFS-210584.
Song, Y., & Pei, F. (2023). An Improved Local Mean-Based Distance Weighted K-Nearest Neighbor with Distance Metrics. IEEE 6th International Conference on Information Systems and Computer Aided Education (ICISCAE).
Syriopoulos, P., Kalampalikis, N., Kotsiantis, S., & Vrahatis, M. (2023). KNN Classification: a review. Ann Math Artif Intell, https://doi.org/10.1007/s10472-023-09882-x.
Wadhwa, S., Kumar, D., Gupta, S., & Kukreja, V. (2022). Dissected Urdu Dots Recognition Using Image Compression and KNN Classifier. International Conference on Data Analytics for Business and Industry (ICDABI).
Xing, W., & Bei, Y. (2019). Medical Health Big Data Classification Based on KNN Classification Algorithm. IEEE Access, https://doi.org/10.1109/ACCESS.2019.2955754.
Yunneng, Q. (2020). A new stock price prediction model based on improved KNN. 7th International Conference on Information Science and Control Engineering (ICISCE), https://doi.org/10.1109/ICISCE50968.2020.00026.
Zhai, G., & Evison, M. (2011). Facial shape analysis based on Euclidean Distance Matrix Analysis. 4th International Conference on Biomedical Engineering and Informatics (BMEI), 1896-1900. https://doi.org/10.1109/ICCSS52145.2020.9336819.
Author Biographies
Faiq Madani, Universitas Diponegoro
Kusworo, Universitas Diponegoro
Farikhin, Universitas Diponegoro
License
Copyright (c) 2024 Faiq Madani, Kusworo, Farikhin

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with Jurnal Penelitian Pendidikan IPA, agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution 4.0 International License (CC-BY License). This license allows authors to use all articles, data sets, graphics, and appendices in data mining applications, search engines, web sites, blogs, and other platforms by providing an appropriate reference. The journal allows the author(s) to hold the copyright without restrictions and will retain publishing rights without restrictions.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in Jurnal Penelitian Pendidikan IPA.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).