Journal Of Artificial Intelligence And Software Engineering
Vol 5, No 3 (2025): September

Comparison of KNN and SVM Performance in 2024 Election Results Sentiment Analysis

Bukit, M Iqbal Fahilla (Unknown)
Lubis, Andre Hasudungan (Unknown)



Article Info

Publish Date
30 Sep 2025

Abstract

This study compares the performance of the K-Nearest Neighbor (KNN) and Support Vector Machine (SVM) algorithms in sentiment analysis related to the 2024 election results using data from social media. The dataset used consists of 506 public opinion entries categorized into three sentiment labels: positive, negative, and neutral. The data processing involved preprocessing steps such as case folding, tokenization, stopword removal, and stemming, then represented using the Term Frequency–Inverse Document Frequency (TF-IDF) method. The test results showed that both algorithms were able to classify with an accuracy of over 70%. The KNN algorithm produced an accuracy of 75.49%, precision of 71.36%, recall of 75.49%, and an F1-score of 72.88%, while the SVM algorithm showed slightly better performance with an accuracy of 77.45%, precision of 70.59%, recall of 77.45%, and F1-score of 72.15%. Based on the confusion matrix analysis, both models have a high ability to classify positive sentiments, but still face obstacles in recognizing negative and neutral sentiments due to the imbalance in data distribution. Overall, this study indicates that SVM is more suitable for election sentiment analysis on high-dimensional text data.

Copyrights © 2025






Journal Info

Abbrev

JAISE

Publisher

Subject

Computer Science & IT

Description

Artificial Intelligence Natural Language Processing Computer Vision Robotics and Navigation Systems Decision Support System Implementation of Algorithms Expert System Data Mining Enterprise Architecture Design & Management Software & Networking Engineering ...