Social media sentiment analysis has become increasingly important with the rise of platforms like Twitter and Facebook as sources of public opinion. This study evaluates the performance of three machine learning algorithms—Naïve Bayes, k-Nearest Neighbors (KNN), and Support Vector Machines (SVM)—in classifying sentiment from social media data. Using a dataset in Indonesian, we apply cross-validation techniques to measure accuracy, precision, recall, F1-score, and computation time for each algorithm. The results show that SVM achieves the highest accuracy and F1-score, while Naïve Bayes offers better computational speed. KNN demonstrates the lowest performance in terms of accuracy and efficiency. These findings provide guidance for practitioners and researchers in selecting the appropriate algorithm for sentiment analysis based on their specific needs.
Copyrights © 2024