Implementasi Data Mining untuk Klasifikasi Penyakit Stroke Menggunakan Algoritma K-Nearest Neighbor
DOI:
https://doi.org/10.55606/kreatif.v5i3.8215Keywords:
data preprocessing, K-Nearest Neighbor, SMOTE, Streamlit, Stroke classificationAbstract
Stroke remains a major global health challenge, with diagnoses often delayed, particularly in primary care facilities with limited infrastructure. This study aimed to develop a stroke risk classification system using the K-Nearest Neighbor (KNN) algorithm, optimized through comprehensive data preprocessing. A secondary dataset of 5,110 patient records was processed using mean imputation for missing BMI values, winsorization to manage outliers, label encoding for categorical variables, and Min-Max normalization for feature scaling. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) was applied prior to stratified data splitting into 70% training and 30% testing sets. The KNN model with K=5 demonstrated strong performance, achieving 96% accuracy, 96% precision, 99% recall, and a 97% F1-score on the test data. Multivariate correlation analysis identified age, hypertension, and blood glucose levels as the primary predictors of stroke risk, consistent with established clinical pathophysiology. These findings highlight the critical role of cardiometabolic risk factors in early detection. The system was implemented as a web application using Streamlit, enabling rapid and interactive screening in primary healthcare centers with minimal infrastructure. This practical application has the potential to assist healthcare providers in early stroke detection, accelerating clinical intervention and reducing the likelihood of long-term complications. Nevertheless, several limitations exist. The reliance on secondary data introduces the possibility of regional bias, and the use of SMOTE generates synthetic data that may affect model generalizability. Future research is recommended to validate the model across multi-source datasets, apply advanced hyperparameter tuning, and explore ensemble learning techniques to further enhance predictive reliability. In conclusion, the KNN-based classification system demonstrates promising potential as a practical decision-support tool for early stroke risk assessment in resource-limited healthcare settings.
References
Akbar, I., Supriadi, F., & Junaedi, D. I. (2025). Pemanfaatan machine learning di bidang kesehatan. JATI (Jurnal Mahasiswa Teknik Informatika), 9(1), 1744–1749.
Aprilitaz, W., Akbar, R., & Prayogi, R. C. (2023, August). Komparasi algoritma K-Nearest Neighbor (KNN) dan Naive Bayes dalam klasifikasi penyakit Parkinson: Comparison of K-Nearest Neighbor (KNN) and Naive Bayes algorithms in the classification of Parkinson's disease. In Sentimas: Seminar Nasional Penelitian dan Pengabdian Masyarakat (pp. 188–193).
Ardhani, N. T., Notodiputro, K. A., & Oktarina, S. D. (2025). Winsorization for outliers in clustering non-cyclical stocks with K-Means and K-Medoids: Winsorization untuk penanganan pencilan dalam penggerombolan saham sektor consumer non-cyclical dengan K-Means dan K-Medoids. Indonesian Journal of Statistics and Its Applications, 9(1), 46–60.
A’yuniyah, Q., & Reza, M. (2023). Penerapan algoritma K-Nearest Neighbor untuk klasifikasi jurusan siswa di SMA Negeri 15 Pekanbaru: Application of the K-Nearest Neighbor algorithm for student department classification at 15 Pekanbaru State High School. Indonesian Journal of Informatic Research and Software Engineering (IJIRSE), 3(1), 39–45.
Bakri, S. N., & Harahap, L. S. (2025). Analisis klasifikasi algoritma K-Nearest Neighbor (KNN) pada struktur daerah di Kota Medan. Jurnal Ilmu Komputer dan Sistem Informasi, 4(2), 182–193.
Bhirawa, A. A., & Sanjaya, U. P. (2025). From data imbalance to precision: SMOTE-driven machine learning for early detection of kidney disease. INOVTEK Polbeng—Seri Informatika, 10(1), 514–525.
Bintang, Y. K., & Imaduddin, H. (2024). Pengembangan model deep learning untuk deteksi retinopati diabetik menggunakan metode transfer learning. JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), 9(3), 1442–1455.
Brian, T., Sholikhah, E. N., Maulidhia, A. N. A., & Wibowo, S. (2025). Application of K-Nearest Neighbor (KNN) algorithm to predict drinking water quality. Jurnal Sistem Telekomunikasi Elektronika Sistem Kontrol Power Sistem dan Komputer, 5(1), 9–16.
Carudin, C., Marisa, M., Murnawan, M., Reba, F., Koibur, M. E., Thantawi, A. M., … & Wattimena, F. Y. (2024). Buku ajar data mining. PT Sonpedia Publishing Indonesia.
Desiani, A. (2022). Perbandingan implementasi algoritma Naïve Bayes dan K-Nearest Neighbor pada klasifikasi penyakit hati. Jurnal Sistem Informasi dan Sistem Komputer, 7(2), 104–110.
Elfaladonna, F., Isa, I. G. T., Sartika, D., & Putra, A. M. (2024). Buku ajar dasar exploratory data analysis (EDA). Penerbit NEM.
Fasnuari, H. A. D., Yuana, H., & Chulkamdi, M. T. (2022). Penerapan algoritma K-Nearest Neighbor untuk klasifikasi penyakit diabetes melitus: Studi kasus warga Desa Jatitengah. Antivirus: Jurnal Ilmiah Teknik Informatika, 16(2), 133–142.
Febiola, A., Ardiningrum, F., Purba, M. O. A., & Siahaan, F. (2025). Implementation of SVM in predicting obesity risk based on lifestyle and dietary patterns. JOMLAI: Journal of Machine Learning and Artificial Intelligence, 4(1), 38–45.
Hendriyani, Y. (2025). Data mining bab. Dasar-dasar data mining: Konsep, teknik dan aplikasi.
Lonang, S., Yudhana, A., & Biddinika, M. K. (2023). Analisis komparatif kinerja algoritma machine learning untuk deteksi stunting. Jurnal Media Informatika Budidarma, 7(4), 2109.
Maulana, M. R., Nugroho, A. P., Adinata, F. C., Haidar, N. B., & Setiawan, A. (2025). KNN-based handwritten digit classification with accuracy analysis and visualization. Jurnal Ilmiah Sistem Informasi, 4(2), 142–150.
Maulana, M. R., Sucipto, A., & Mulyo, H. M. (2024). Optimisasi parameter support vector machine dengan particle swarm optimization untuk peningkatan klasifikasi diabetes. Jurnal Informatika Teknologi dan Sains (Jinteks), 6(4), 802–812.
Mutoffar, M. M., Retnoningsih, E., Yasik, I. Y. L., & Eliza, S. T. (2025). Decoding intelligence: Algoritma machine learning dalam aksi dan bisnis. PT Kimhsafi Alung Cipta.
Nikmawati, S., Warlem, N., & Izrul, I. (2024). Pemberian edukasi dalam rangka Hari Stroke Sedunia tahun 2024. Jurnal Pengabdian Masyarakat Kesehatan (JURABDIKES), 2(2), 49–54.
Nova, N., Mulyanti, A., Burhanie, C. S. A. P., Mulyani, L., Nurjanah, R. G., Utami, W., & Sukaesih, N. S. (2025). Systematic review: Pemanfaatan deep learning untuk diagnosis penyakit menggunakan MRI. Jurnal Penelitian Inovatif, 5(2), 839–852.
Nurlaela, L., Suhanda, Y., Sopian, A., Dewi, C. S., & Syahrial, R. (2025). Pengembangan framework data mining berbasis deep neural network dengan eksplorasi teknik transfer learning untuk prediksi dan klasifikasi data. JRIS: Jurnal Rekayasa Informasi Swadharma, 5(1), 132–141.
Pratama, Y. D., & Salam, A. (2025). Comparison of data normalization techniques on KNN classification performance for Pima Indians diabetes dataset. Journal of Applied Informatics and Computing, 9(3), 693–706.
Primajaya, A., Sari, B. N., & Padilah, T. N. (2022). Diseminasi hasil penelitian research group software engineering, data science, computational intelligent and optimization, computer network and security, information system. Uwais Inspirasi Indonesia.
Putra, R. F., Zebua, R. S. Y., Budiman, B., Rahayu, P. W., Bangsa, M. T. A., Zulfadhilah, M., … & Andiyan, A. (2023). Data mining: Algoritma dan penerapannya. PT Sonpedia Publishing Indonesia.
Sahelvi, E., Cikita, P., Sapitri, R. M., Rahmaddeni, R., & Efrizoni, L. (2025). Perbandingan algoritma K-Nearest Neighbors dan Random Forest untuk rekomendasi gaya hidup sehat dalam mencegah penyakit jantung: Comparison of K-Nearest Neighbors and Random Forest algorithms for recommendations for a healthy lifestyle in preventing heart disease. MALCOM: Indonesian Journal of Machine Learning and Computer Science, 5(3), 830–840.
Santoso, L., & Priyadi, P. (2024). Mengoptimalkan proses pembersihan data dalam analisis big data menggunakan pipeline berbasis AI. Elkom: Jurnal Elektronika dan Komputer, 17(2), 657–666.
Sheila, S. (2024). Analisis performa algoritma C4.5 dan klasifikasi decision tree dalam memprediksi penyakit diabetes: Performance analysis of C4.5 algorithm and decision-tree classification in predicting diabetes. Sistem dan Teknologi Informasi Indonesia (SINTESIA), 4(1), 1–9.
Shinami, M. A., & Bahri, S. (2023). Klasifikasi penyakit kanker payudara menggunakan metode K-Nearest Neighbors (KNN). Jurnal Fourier, 12(2), 79–85.
Siregar, A. H., & Siregar, S. D. (2025). Comparison of logistic regression and support vector machine algorithm performance in heart failure prediction. Academia Open, 10(2), 10–21070.
Sulianta, F. (2023). Basic data mining from A to Z. Feri Sulianta.
Swastika, R., Mukodimah, S., Susanto, F., Muslihudin, M., & Adab, S. I. P. (2023). Implementasi data mining (clustering, association, prediction, estimation, classification). Penerbit Adab.
Syam, S., Tokoro, Y., Judijanto, L., Garonga, M., Sinaga, F. M., Umar, N., … & Sitanggang, A. T. (2024). Data mining: Teori dan penerapannya dalam berbagai bidang. PT Sonpedia Publishing Indonesia.
Ujianto, N. T., Fadillah, H., Fanti, A. P., Saputra, A. D., & Ramadhan, I. G. (2025). Penerapan algoritma K-Nearest Neighbors (KNN) untuk klasifikasi citra medis. IT-Explore: Jurnal Penerapan Teknologi Informasi dan Komunikasi, 4(1), 33–43.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 KREATIF: Jurnal Pengabdian Masyarakat Nusantara

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.