Implementation of the K-Nearest Neighbor Algorithm for Environmental Security Level Classification Based on Crime Data - Muhammad Aidil Affan; Alya Winanda (Ali Institute of Reseach and Publication, 2026)
This study aims to evaluate the effectiveness and performance of the K-Nearest Neighbor (KNN) algorithm in classifying regional security levels based on crime data. Secondary data are used with a quantitative research approach, applying KNN as the classification method and the Confusion Matrix as the evalution metric. The dataset consists of September and October data as training data and November data as testing data, with features including the number of crimes, theft cases, and violence cases. The result show that KNN achieves an accuracy of 96.15%, with a precision of 1.00 for the safe and vulnerable classes, a recall of 1.00 for the safe and alert classes, and 0.80 for the vulnerable class. This study demonstrates that KNN can effectively classify regional security levels and support decision-making based on official crime data.