Klasifikasi Tingkat Serangan pada Log Jaringan Siber dengan Komparasi Naive Bayes dan K-Nearest Neighbor - Apriliani, Evinda; Winiarti, Sri; Riadi, Imam; Yuliansyah, Herman (Building of Informatics, Technology and Science (BITS), 2025)
The increasing threat of cybersecurity poses a significant impact on both organizations and individuals, necessitating a system capable of accurately detecting and classifying attack levels to support prioritization of responses. This study aims to analyze and compare the performance of two machine learning algorithms, Naive Bayes and K-Nearest Neighbor (KNN), in classifying cyberattack levels, and to evaluate the effect of hyperparameter tuning on improving model accuracy. The research methods included utilizing the cybersecurity_attacks dataset, data preprocessing, model training at three data split ratios (70:30, 80:20, and 90:10), and parameter optimization using Randomized Search and Grid Search. Performance evaluation was based on accuracy, precision, recall, and F1-score values. The results showed that KNN performed best, with a peak accuracy of 0.96 at the 80:20 ratio after tuning, increased from an accuracy of 0.947 before tuning, with precision, recall, and F1-score values ​​ranging from 0.95 to 0.96. Meanwhile, Naive Bayes only achieved a peak accuracy of 0.8485 at the same ratio. Although the improvement after hyperparameter tuning was not significant, this process still resulted in a more stable and consistent model. Future research is recommended to explore ensemble methods and test them on other datasets to produce more adaptive cyberattack classification models.