Implementasi Algoritma K-Nearest Neighbor untuk Klasifikasi Cuaca

  • Dandy Dandy Universitas Multi Data Palembang
  • Daniel Udjulawa Universitas Multi Data Palembang
  • Yohannes Yohannes Universitas Multi Data Palembang
Keywords: Classification, K-Nearest Neighbor, Weather

Abstract

Weather is a brief natural event concerning the atmospheric conditions that take place on Earth which are determined by pressure, wind speed, temperature, and air phenomena. This study classifies 3 weather classes, namely sunny, cloudy, and rainy using the K-Nearest Neighbor algorithm as a weather classification algorithm with K value parameters of 3, 5, 7, and 9. Weather dataset 96.453 data to be examined is data taken from the Kaggle website. The dataset is divided into training data and test data with a ratio of 80:20. The implementation of the K-Nearest Neighbor algorithm produces a confusion matrix and classification report where in the confusion matrix, the largest number of correctly predicted data is at the value K = 9, namely 13.132 correctly predicted data with the largest number of correctly predicted data in the cloudy class, namely 10.865 data. As for the classification report, the highest accuracy value for both the cloudy, rainy, and sunny weather classes is at K = 9, which is 68.073%, and the highest precision, recall, and f1-score values are found in the cloudy class at K = 9, respectively contributed 72.095%, 89.288%, and 79.775%.

Published
2023-10-10
How to Cite
Dandy, D., Udjulawa, D., & Yohannes, Y. (2023, October 10). Implementasi Algoritma K-Nearest Neighbor untuk Klasifikasi Cuaca. Jurnal Algoritme, 4(1), 1-12. https://doi.org/https://doi.org/10.35957/algoritme.v4i1.4932