K Value Effect on Accuracy Using the K-NN for Heart Failure Dataset
DOI:
https://doi.org/10.30812/matrik.v22i3.2984Keywords:
Heart failure, K-Nearest Neighbors, Manhattan Distance, PreprocessingAbstract
Heart failure is included in the category of cardiovascular disease. Heart disease is not easy to detect, and its detection needs to be done by experienced and skilled medical professionals. Most patients with heart failure require hospitalization. Common symptoms of heart disease, such as chest pain and high or low blood pressure, vary from person to person. This study aims to find the most optimal k value based on the accuracy obtained based on calculations by testing different k values, namely 1, 3, 5, 7, and 9. After getting the results of the accuracy of the five k values, compare which accuracy has the highest value, best for K-Nearest Neighbor (K-NN) models. The classification process uses the K-NN algorithm. This algorithm is quite easy to use because some parameters work using distance metrics and k values. Therefore, the value of k in the K-NN algorithm greatly affects the accuracy that will be produced. In the results of this study, the accuracy obtained was k = 7 and k = 9, which are the most optimal results because they have the highest accuracy compared to other k values, with an accuracy of 88%. The expected benefit of this research is that it can make a scientific contribution to research in the field of machine learning classification, especially in predicting heart failure
Downloads
References
of the 2019 IEEE International Conference on Communication and Signal Processing, ICCSP 2019, pp. 848–852, 2019.
[2] B. Rahman, H. L. Hendric SpitsWarnars, B. Subirosa Sabarguna, andW. Budiharto, “Heart Disease Classification Model Using
K-Nearest Neighbor Algorithm,†2021 6th International Conference on Informatics and Computing, ICIC 2021, 2021.
[3] D. Chicco and G. Jurman, “Machine learning can predict survival of patients with heart failure from serum creatinine and
ejection fraction alone,†BMC Medical Informatics and Decision Making, vol. 20, no. 1, 2020.
[4] H. Agrawal, J. Chandiwala, S. Agrawal, and Y. Goyal, “Heart Failure Prediction using Machine Learning with Exploratory Data
Analysis,†2021 International Conference on Intelligent Technologies, CONIT 2021, 2021.
[5] C. Sowmiya and P. Sumitra, “Analytical study of heart disease diagnosis using classification techniques,†Proceedings of the
2017 IEEE International Conference on Intelligent Techniques in Control, Optimization and Signal Processing, INCOS 2017,
vol. 2018-Febru, pp. 1–5, 2018.
[6] R. Yunus, U. Ulfa, and M. D. Safitri, “Application of the K-Nearest Neighbors (K-NN) Algorithm for Classification of Heart
Failure,†Journal of Applied Intelligent System, vol. 6, no. 1, pp. 1–9, 2021.
[7] M. Alehegn, R. R. Joshi, and P. Mulay, “Diabetes analysis and prediction using random forest, KNN, Na¨ıve Bayes, and J48: An
ensemble approach,†International Journal of Scientific and Technology Research, vol. 8, no. 9, pp. 1346–1354, 2019.
[8] O. Terrada, B. Cherradi, A. Raihani, and O. Bouattane, “Atherosclerosis disease prediction using Supervised Machine Learning
Techniques,†2020 1st International Conference on Innovative Research in Applied Science, Engineering and Technology,
IRASET 2020, 2020.
[9] I. Kumar, K. Dogra, C. Utreja, and P. Yadav, “A Comparative Study of Supervised Machine Learning Algorithms for Stock
Market Trend Prediction,†Proceedings of the International Conference on Inventive Communication and Computational Technologies,
ICICCT 2018, no. Icicct, pp. 1003–1007, 2018.
[10] A. Upadhyay, S. Nadar, and R. Jadhav, “Comparative study of SVM & KNN for signature verification,†Journal of Statistics
and Management Systems, vol. 23, no. 2, pp. 191–198, 2020.
[11] A. Almomany, W. R. Ayyad, and A. Jarrah, “Optimized implementation of an improved KNN classification algorithm using
Intel FPGA platform: Covid-19 case study,†Journal of King Saud University - Computer and Information Sciences, vol. 34,
no. 6, pp. 3815–3827, 2022.
[12] Z. Ma, Z., Li, H., & Wang, “Early detection of heart failure using k-nearest neighbors algorithm with feature selection,†International
Journal of Advanced Robotic Systems, vol. 17, no. 4, 2020.
[13] N. Jayapandian, C. P., & Sundararajan, “A comparative analysis of K-nearest neighbors and support vector machine algorithms
for heart disease prediction,†Journal of Ambient Intelligence and Humanized Computing, vol. 10, no. 10, pp. 4157–4167, 2019.
[14] A. Kishor and W. Jeberson, “Diagnosis of Heart Disease Using Internet of Things and Machine Learning Algorithms,†Lecture
Notes in Networks and Systems, vol. 203 LNNS, pp. 691–702, 2021.
[15] C. B. C. Latha and S. C. Jeeva, “Improving the accuracy of prediction of heart disease risk based on ensemble classification
techniques,†Informatics in Medicine Unlocked, vol. 16, p. 100203, 2019.
[16] S. Alam and N. Yao, “The impact of preprocessing steps on the accuracy of machine learning algorithms in sentiment analysis,â€
Computational and Mathematical Organization Theory, vol. 25, no. 3, pp. 319–335, 2019.
[17] A. Murugan, S. A. H. Nair, and K. P. Kumar, “Detection of Skin Cancer Using SVM, Random Forest and kNN Classifiers,â€
Journal of Medical Systems, vol. 43, no. 8, 2019.
[18] G. S. Reddy Thummala and R. Baskar, “Prediction of Heart Disease using Decision Tree in Comparison with KNN to Improve
Accuracy,†pp. 1–5, 2022.
[19] S. Uddin, A. Khan, M. E. Hossain, and M. A. Moni, “Comparing different supervised machine learning algorithms for disease
prediction,†BMC Medical Informatics and Decision Making, vol. 19, no. 1, 2019.
[20] Z. Mushtaq, A. Yaqub, S. Sani, and A. Khalid, “Effective K-nearest neighbor classifications for Wisconsin breast cancer data
sets,†Journal of the Chinese Institute of Engineers, Transactions of the Chinese Institute of Engineers,Series A, vol. 43, no. 1,
pp. 80–92, 2020.
[21] S. Uddin, I. Haque, H. Lu, M. A. Moni, and E. Gide, “Comparative performance analysis of K-nearest neighbour (KNN)
algorithm and its different variants for disease prediction,†Scientific Reports, vol. 12, no. 1, 2022.
Downloads
Published
Issue
Section
How to Cite
Similar Articles
- Guntoro Guntoro, Lisnawita Lisnawita, Loneli Costaner, Optimizing Random Forest for IoT Cyberattack Detection using SMOTE: A Study on CIC-IoT2023 Dataset , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 25 No. 1 (2025)
- Rizky Afrinanda, Lusiana Efrizoni, Wirta Agustin, Rahmiati Rahmiati, Hybrid Model for Sentiment Analysis of Bitcoin Prices using Deep Learning Algorithm , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 22 No. 2 (2023)
- Siti Ummi Masruroh, Cong Dai Nguyen, Doni Febrianus, Comparative Analysis of TF-IDF and Modern Text Embedding for the Classification of Islamic Ideologies on Indonesian Twitter , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 25 No. 1 (2025)
- Putu Tisna Putra, Anthony Anggrawan, Hairani Hairani, Comparison of Machine Learning Methods for Classifying User Satisfaction Opinions of the PeduliLindungi Application , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 22 No. 3 (2023)
- Dadang Priyanto, Bambang Krismono Triwijoyo, Deny Jollyta, Hairani Hairani, Ni Gusti Ayu Dasriani, Data Mining Earthquake Prediction with Multivariate Adaptive Regression Splines and Peak Ground Acceleration , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 22 No. 3 (2023)
- M. Khairul Anam, Bunga Nanti Pikir, Muhammad Bambang Firdaus, Susi Erlinda, Agustin Agustin, Penerapan Na ̈ıve Bayes Classifier, K-Nearest Neighbor (KNN) dan Decision Tree untuk Menganalisis Sentimen pada Interaksi Netizen dan Pemeritah , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 21 No. 1 (2021)
- Sri Ayu Rosiva Srg, Muhammad Zarlis, Wanayumini Wanayumini, Klasifikasi Citra Daun dengan GLCM (Gray Level Co-Occurence) dan K-NN (K-Nearest Neighbor) , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 21 No. 2 (2022)
- Denny Indrajaya, Adi Setiawan, Bambang Susanto, Comparison of k-Nearest Neighbor and Naive Bayes Methods for SNP Data Classification , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 22 No. 1 (2022)
You may also start an advanced similarity search for this article.
Most read articles by the same author(s)
- Tugiman Tugiman, Herman Herman, Anton Yudhana, The UTAUT Model for Measuring Acceptance of the Application of the Patient Registration System , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 22 No. 2 (2023)
- Imam Riadi, Herman Herman, Fitriah Fitriah, Suprihatin Suprihatin, Optimizing Inventory with Frequent Pattern Growth Algorithm for Small and Medium Enterprises , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 23 No. 1 (2023)
- Egi Dio Bagus Sudewo, Muhammad Kunta Biddinika, Abdul Fadlil, DenseNet Architecture for Efficient and Accurate Recognition of Javanese Script Hanacaraka Character , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 23 No. 2 (2024)
- Virdiana Sriviana Fatmawaty, Imam Riadi, Herman Herman, Higher Education Institution Clustering Based on Key Performance Indicators using Quartile Binning Method , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 24 No. 1 (2024)
- Imam Riadi, Herman Herman, Nur Hamida Siregar, Mobile Forensic of Vaccine Hoaxes on Signal Messenger using DFRWS Framework , MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer: Vol. 21 No. 3 (2022)
.png)











