Analisis Sentimen Twitter Pengaruh Tokoh Politik dengan Menggunakan Metode K-Nearest Neighbor
Abstract
Public opinion towards political figures can consist of positive and negative sentiments. Besides that, social media has developed which can be used as a forum for public opinion, one of which is Twitter. From this public opinion, sentiment analysis is formed which uses a classification algorithm. This work leverages the K-Nearest Neighbor (KNN) algorithm, which classifies data based on its similarity to existing data points. Tweets undergo preprocessing, followed by TF-IDF weighting for keyword importance and confusion matrix calculations for calculate theevaluation of algorithm. By analyzing the nearest neighbors, sentiment values are assigned. The KNN model achieved an accuracy of 84,06% for k = 5, precision of 86,70% for k = 5, recall of 95,89% for k = 7, and F1-score of 90,93% for k = 5, demonstrating its effectiveness in assessing sentiment and influence through Twitter data. This research contributes to the field of political communication by offering a robust method for analyzing public opinion and gauging the influence of political figures on social media platforms.