ANALISIS PERFORMA K-NEAREST NEIGHBOR UNTUK PREDIKSI STROKE BERDASARKAN DATA KESEHATAN PASIEN
Abstract
Stroke remains one of the highest causes of death in many countries, including Indonesia, making early detection efforts essential to suppress serious risks for patients. The main challenge that often arises is how to utilize patient health data to provide rapid and accurate disease prediction. This study aims to analyze the accuracy level of the K-Nearest Neighbor (K-NN) algorithm in predicting stroke based on a number of health parameters such as age, gender, history of hypertension, and other risk factors. The research method was carried out through the stages of data collection, cleaning process, normalization using StandardScaler, and testing the KNN model with variations of training and test data. The results show that the KNN model is capable of providing reasonably good classification performance with an accuracy of 93.56%, an average precision value of 0.94, and recall and f1-scores each reaching 0.94. This finding indicates that KNN has the potential to be used as a data-driven stroke prediction tool, thereby supporting decision-making in early detection systems in the medical field.
References
[2] M. N. Maskuri, K. Sukerti, and R. M. H. Bhakti, “Penerapan Algoritma K-Nearest Neighbor ( KNN ) untuk Memprediksi Penyakit Stroke,” vol. 4, no. 1, pp. 130–140, 2022.
[3] I. V. Annisa Cintakami Firdaus, “Penerapan Algoritma K-Nearest Neighbor ( KNN ) untuk Memprediksi Stroke pada Rumah Sakit Pusat Otak Nasional Prof .,” vol. 26, no. 1, pp. 144–153.
[4] E. F. Nopitasari, S. Putri, A. Alkadri, R. Wahid, S. Insani, and K. Barat, “Implementasi Data Mining untuk Klasifikasi Penyakit Stroke Menggunakan Algoritma K-Nearest Neighbor,” vol. 5, no. September, pp. 344–365, 2025.
[5] Z. Rahman et al., “KLASIFIKASI SPESIES BUNGA IRIS MENGGUNAKAN ALGORITMA KLASIFIKASI KNN DI RAPIDMINER,” vol. 1, no. 6, pp. 60–66, 2024.
[6] T. T. H. Dimas Cahyo Saputra, Gabriel Carol Aldosion, Salsha Sabilla Nurhidayat, Sukrinah, “Implementasi Algoritma K-Nearest Neighbor ( Knn ) Menggunakan Rapid Miner Untuk Prediksi Penyakit Diabetes Berdasarkan Dataset Pima Indian,” vol. 1, no. 1, pp. 36–40, 2025.
[7] R. Y. R. Muhammad Sholeh, Dina Andayati, “DATA MINING MODEL KLASIFIKASI MENGGUNAKAN K-NEAREST NEIGHBOR WITH NORMALIZATION FOR DIABETES PREDICTION,” pp. 77–87.
[8] C. Paramita, C. S. Simbolon, A. S. Pamungkas, J. M. Triono, P. W. Utomo, and E. R. Subhiyakto, “Analisis Pengaruh SMOTE terhadap Kinerja Model KNN untuk Prediksi Risiko Stroke,” vol. 10, no. 4, pp. 978–988, 2025, doi: 10.30591/jpit.v10i4.8809.
[9] A. Yogianto, A. Homaidi, and Z. Fatah, “Implementasi Metode K-Nearest Neighbors (KNN) untuk Klasifikasi Penyakit Jantung,” vol. 8, no. 3, pp. 1720–1728, 2024.
[10] A. Devi et al., “PENERAPAN MACHINE LEARNING DENGAN K-NEAREST NEIGHBORS ( KNN ) UNTUK IDENTIFIKASI JENIS BUNGA,” vol. 6, no. 2, pp. 205–213, 2025.
[11] N. T. Ujianto, H. Fadilah, A. P. Fanti, and A. D. Saputra, “Penerapan algoritma K-Nearest Neighbors ( KNN ) untuk klasifikasi citra medis,” vol. 02, pp. 33–43, 2025.
[12] Z. Khairi, R. Yanti, T. A. Fitri, and E. Fatdha, “Optimasi Algoritma Knn Menggunakan Smote Untuk Prediksi Stroke,” pp. 164–175, 2025, doi: 10.33364/algoritma/v.22-2.2474.
[13] N. K. A. P. Muhammad Yunus, “Prediksi Status Gizi Balita Dengan Algoritma K-Nearest,” vol. 4, no. 4, pp. 221–231, 2023.
[14] A. R. Hakim and A. Chamid, “Klasifikasi Tingkat Kelayakan Tabung Gas 3KG Berbasis Citra Tekstur GLCM Menggunakan Metode Support Vector Machine ( SVM ) dan K-Nearest Neigbors ( K-NN ),” vol. 11, no. 1, pp. 1–6, 2025.
[15] B. Andriska, C. Permana, M. Sadali, and R. Ahmad, “Penerapan Model Decision Tree Menggunakan Python Untuk Prediksi Faktor Dominan Penyebab Penyakit Stroke,” vol. 7, no. 1, pp. 23–31, 2024.
[16] A. J. Wahidin and W. A. Syukrilla, DATA MINING. PT GLOBAL EKSEKUTIF TEKNOLOGI Anggota IKAPI No. 033/SBA/2022, 2023.
[17] U. Oktavia, R. Permatasari, W. J. Shudiq, and M. Jasri, “Prediksi Kelayakan Mahasiswa sebagai Penerima Beasiswa Bank Indonesia pada Tahap Seleksi Administrasi di Universitas Nurul Jadid Menggunakan Algoritma K Nearest Neighbor,” vol. xx, no. xx, pp. 252–260, 2024, doi: 10.33650/jeecom.v4i2.
[18] D. N. Aini, B. Oktavianti, M. J. Husain, D. A. Sabillah, and S. T. Rizaldi, “Seleksi Fitur untuk Prediksi Hasil Produksi Agrikultur pada Algoritma K-Nearest Neighbor ( KNN ),” vol. 4, no. September, pp. 140–145, 2022, doi: 10.30865/json.v4i1.4813.
[19] I. H. Kusuma and N. Cahyono, “Analisis Sentimen Masyarakat Terhadap Penggunaan E-Commerce Menggunakan Algoritma K-Nearest Neighbor,” vol. 8, no. 3, pp. 302–307, 2023.
[20] A. Rahman, M. S. Hasibuan, and A. H. Lubis, “Sales Prediction of Kembar Fruit Salad Homemade Products Based on Transaction Data Using K-Nearest Neighbor,” vol. 5, no. 1, pp. 115–127, 2025.
[21] I. M. Dendi and M. Sanjaya, BUKU AJAR DATA MINING, no. January. 2024.
[22] K. N. Dalam, M. Kualitas, and J. Pomelo, “Analisis metode classification menggunakan algoritma k-nearest neighbor dalam menentukan kualitas jeruk pomelo,” vol. 8, pp. 115–121, 2025, doi: 10.37600/tekinkom.v8i1.1970.
[23] M. R. Talipi, “Prediksi status anemia pada ibu hamil menggunakan algoritma k-nearest neighbors (k-nn),” 2024.
[24] L. A. Dewi, P. S. Fisika, F. Sains, D. A. N. Teknologi, U. Islam, and N. Syarif, “KLASIFIKASI MACHINE LEARNING UNTUK MENDETEKSI PENYAKIT JANTUNG DENGAN ALGORITMA K-NN , DECISION TREE DAN RANDOM FOREST,” 2023.





