Awang Hendrianto
Unknown Affiliation

Published : 1 Documents Claim Missing Document
Claim Missing Document
Check
Articles

Found 1 Documents
Search

Application of the Particle Swarm Optimization Algorithm to the Optimization of the K-Nearest Neighbor Algorithm in Rain Classification Hanif Muhammad Rizqi; Rifki Indra Perwira; Awang Hendrianto
Telematika Vol 23 No 2 (2026): Edisi Juni 2026
Publisher : Jurusan Informatika

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.31315/telematika.v23i2.10674

Abstract

Rain classification consists of several categories of rain, such as light rain, moderate rain, and heavy rain. Classification is also useful in managing water resources and disaster mitigation, both floods and landslides. One of the methods used to classify rainfall is K-Nearest Neighbor (KNN). However, KKN has a weakness, namely in determining the value of the parameter k which is not maximized. Therefore, to cover the weaknesses of the KNN method, an optimization is needed for the K value using the Particle Swarm Optimization method so that the accuracy results obtained are optimal..PSO will optimize the selection of K values by initializing the respective K value particles used for KNN classification, then updating the position and velocity based on PBest and GBest. The process will be repeated in certain iterations until the criteria are met and will produce an optimal K value. The optimized K value will then be used for the KNN classification process.Based on the model that has been made with a total of 525578 training data and 41268 test data has the most optimal K value, namely K = 7. From the K value by testing using the confusion matrix obtained an accuracy of 99.88%. From optimizing using PSO on KNN, getting a better time in selecting K values is 3 minutes 52 seconds, whereas without optimizing using PSO on KNN, you get approximately 5 minutes. This proves that PSO optimization on KNN can provide good time efficiency in selecting the most optimal K value