Analisis Perbandingan Algoritma K-Nearest Neighbor (KNN) Dan Random Forest Dalam Klasifikasi Risiko Penyakit Diabetes
DOI:
https://doi.org/10.62411/tc.v25i4.18204Abstract
Diabetes Mellitus merupakan salah satu penyakit tidak menular (PTM) yang menjadi ancaman kesehatan global secara signifikan. Deteksi dini terhadap risiko diabetes sangat krusial untuk mencegah komplikasi kronis dan menekan angka mortalitas. Penelitian ini menganalisis dan membandingkan performa algoritma K-Nearest Neighbor (KNN) dan Random Forest dalam mengklasifikasikan risiko penyakit diabetes menggunakan dataset Pima Indians Diabetes dari repositori Kaggle (768 sampel, 8 atribut klinis). Praproses data meliputi imputasi median pada nilai nol tidak valid, pembagian data 80:20 dengan stratified holdout, dan normalisasi Z-Score. Hasil pengujian menunjukkan Random Forest (100 pohon) secara konsisten mengungguli KNN (K=7) pada seluruh metrik: akurasi 86,36% berbanding 75,97%, presisi 84,62% berbanding 74,58%, recall 83,33% berbanding 66,67%, dan F1-score 83,97% berbanding 70,40%. Evaluasi 10-fold cross-validation memperkuat temuan ini (Random Forest 86,48%±5,18% vs KNN 75,06%±5,79%). Analisis feature importance mengidentifikasi Glucose (30,52%) dan BMI (18,23%) sebagai prediktor paling berpengaruh. Random Forest disimpulkan lebih efektif dan direkomendasikan sebagai dasar sistem pendukung keputusan klinis untuk skrining awal risiko diabetes. Kata Kunci: Diabetes Mellitus, Pembelajaran Mesin, K-Nearest Neighbor, Random Forest, Klasifikasi Risiko, Evaluasi Performa.Downloads
Published
Issue
Section
License
Copyright (c) 2026 Tri Aji Tunggal Saputra, Siti Mariam, Halifatun Hasifah, Muhammad Farhan

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License Terms
All articles published in Techno.COM Journal are licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). This means:
1. Attribution
Readers and users are free to:
-
Share – Copy and redistribute the material in any medium or format.
-
Adapt – Remix, transform, and build upon the material.
As long as proper credit is given to the original work by citing the author(s) and the journal.
2. Non-Commercial Use
-
The material cannot be used for commercial purposes.
-
Commercial use includes selling the content, using it in commercial advertising, or integrating it into products/services for profit.
3. Rights of Authors
-
Authors retain copyright and grant Techno.COM Journal the right to publish the article.
-
Authors can distribute their work (e.g., in institutional repositories or personal websites) with proper acknowledgment of the journal.
4. No Additional Restrictions
-
The journal cannot apply legal terms or technological measures that restrict others from using the material in ways allowed by the license.
5. Disclaimer
-
The journal is not responsible for how the published content is used by third parties.
-
The opinions expressed in the articles are solely those of the authors.
For more details, visit the Creative Commons License Page:
? https://creativecommons.org/licenses/by-nc/4.0/









