Building of Informatics, Technology and Science
Vol 6 No 4 (2025): March 2025

Perbandingan Algoritma Naïve Bayes dan Random Forest untuk Melakukan Analisis Sentimen Cyberbullying Generasi Z Pada Twitter

Danuarta, Ervin (Unknown)
Alita, Debby (Unknown)



Article Info

Publish Date
07 Mar 2025

Abstract

Cyberbullying is a significant social problem, especially for Generation Z,who actively use social media such as Twitter, Instagram and TikTok. It has a very negative impact on the victim's mental health, such as a sense of isolation, loss of confidence, and insecurity. This study aims to compare the performance of two machine learning algorithms, namely Naive Bayes and Random Forest, in sentiment analysis related to cyberbullying in Generation Z through the Twitter platform. The research method involved collecting and preprocessing data from 5505 tweets, which were then divided into training data (80%) and test data (20%). The research also applied Synthetic Minority Oversampling Technique (SMOTE) to overcome data imbalance. Preliminary results show that before the application of SMOTE, Naïve Bayes had an accuracy of 92% and Random Forest reached 94%. After the application of SMOTE, the performance of both algorithms changed. Naive Bayes accuracy decreased to 89%, with precision increasing from 92% to 99% for negative sentiments, but recall dropped from 100% to 79%, resulting in an F1-Score of 88%. In contrast, Random Forest showed significant improvement, with accuracy reaching 100%, precision and recall for negative sentiment remaining 100%, and F1-Score increasing from 97% to 100%. This study concludes that Random Forest, with the application of SMOTE, provides more stable and effective performance than Naive Bayes in cyberbullying sentiment analysis. These results are expected to support the development of text analysis technology and efforts to prevent cyberbullying in Generation Z.

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. ...