Building of Informatics, Technology and Science
Vol 7 No 3 (2025): December 2025

Klasifikasi Tingkat Serangan pada Log Jaringan Siber dengan Komparasi Naive Bayes dan K-Nearest Neighbor

Apriliani, Evinda (Unknown)
Winiarti, Sri (Unknown)
Riadi, Imam (Unknown)
Yuliansyah, Herman (Unknown)



Article Info

Publish Date
26 Dec 2025

Abstract

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.

Copyrights © 2025






Journal Info

Abbrev

bits

Publisher

Subject

Computer Science & IT

Description

Building of Informatics, Technology and Science (BITS) is an open access media in publishing scientific articles that contain the results of research in information technology and computers. Paper that enters this journal will be checked for plagiarism and peer-rewiew first to maintain its quality. ...