Abstract: Lung cancer is most deadly cancers in the world. Identification and classification of the causes of understanding lung cancer is essential for developing more effective prevention and treatment strategies. The issue is that a lot of individuals are unaware about the characteristics and causes of lung cancer. The purpose of this study is to apply the K-Nearest Neighbor (K-NN) algorithm in the classification of the causes of lung cancer and provide education to the public must be aware of the traits of lung cancer patients and, to stay away from the causes of lung cancer. The dataset used consists of 309 samples with 16 relevant attributes. The K-NN algorithm was trained and tested to assess its ability to classify the factors that cause lung cancer. The results showed an accuracy of 90.32%, with a precision for the "YES" class of 96% and the "NO" class of 67%. The recall value for the "YES" class was 92% and for the "NO" class was 80%. The implementation of this algorithm gives good results in classification and can help in early detection and prevention of lung cancer which can be used in the development of more effective prevention and early diagnosis strategies. Keywords: lung cancer; k-nearest neighbor; classification; machine learning  Abstrak: Kanker paru-paru tergolong jenis penyakit kanker yang memperoleh angka kematian paling tinggi di dunia. Identifikasi dan klasifikasi penyebab kanker paru-paru sangat penting untuk pengembangan strategi pencegahan dan pengobatan yang lebih efektif. Masalah yang terjadi adalah banyak orang yang belum mengetahui tentang ciri-ciri dan penyebab-penyebab dari kangker paru tersebut. Tujuan penelitian ini adalah mengimplementasikan algoritma K-Nearest Neighbor (K-NN) dalam klasifikasi penyebab kanker paru-paru serta memberikan edukasi kepada masyarakat banyak agar mengetahui ciri-ciri orang yang mengidap kangker paru-paru dan tentunya untuk menghindari penyebab-penyebab dari kangker paru-paru tersebut. Dataset yang digunakan terdiri dari 309 sampel dengan 16 atribut yang relevan. Algoritma K-NN kemudian dilatih dan diuji untuk menilai kemampuannya dalam mengklasifikasikan faktor-faktor penyebab kanker paru-paru. Hasil penelitian menunjukkan akurasi sebesar 90.32%, dengan skor precision untuk kelas "YES" sebesar 96% dan kelas "NO" sebesar 67%. Nilai recall untuk kelas "YES" adalah 92% dan untuk kelas "NO" sebesar 80%. Implementasi algoritma ini memberikan hasil yang baik dalam klasifikasi dan dapat membantu dalam deteksi dini serta pencegahan kanker paru-paru yang dapat digunakan dalam pengembangan strategi pencegahan dan diagnosis dini yang lebih efektif. Kata kunci: kanker paru-paru; k-nearest neighbor; klasifikasi; machine learning
                        
                        
                        
                        
                            
                                Copyrights © 2024