Implementasi K-Nearest Neighbor (KNN) dalam Mengidentifikasi Pola Dukungan terhadap Kandidat Presiden 2024 Berdasarkan Data X

Social media has become an important space for expressing opinions and support during the 2024 Indonesian Presidential Election. However, identifying political support from tweets is challenging because positive or negative expressions do not necessarily indicate support for or rejection of a candidate. This study aims to identify patterns of support for the 2024 presidential candidates using the K-Nearest Neighbor (KNN) method. A total of 1,997 tweets about Prabowo, Anies, and Ganjar were collected from Platform X. The tweets were labeled using rule-based Weak Supervision, combining rules with a lexicon developed for the 2024 presidential election context. After text preprocessing, the data were represented using Term Frequency-Inverse Document Frequency (TF-IDF) and classified with KNN. The dataset was divided into 80% training data and 20% testing data. The model was evaluated using K values of 3, 5, 7, and 9. The best performance was obtained at K = 7, with 91.00% accuracy, 89.48% precision, 91.00% recall, and an 89.24% F1-score. The confusion matrix showed that the model classified neutral tweets more effectively than supporting and non-supporting tweets. These results indicate that KNN with TF-IDF can identify political support patterns, although class imbalance remains a challenge, particularly for minority classes.

Authors

Institutions

Publication Details

Journal
Manufaktur
Published
2026-12-03
DOI
https://doi.org/10.61132/manufaktur.v4i4.1856
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Implementasi K-Nearest Neighbor (KNN) dalam Mengidentifikasi Pola Dukungan terhadap Kandidat Presiden 2024 Berdasarkan Data X

Irene Realyta Halldy Trosi Tangkawarow, Stralen Pratasik, Maria Rina Rumengan
Manufaktur
Sentiment Analysis and Opinion Mining
article

Implementasi K-Nearest Neighbor (KNN) dalam Mengidentifikasi Pola Dukungan terhadap Kandidat Presiden 2024 Berdasarkan Data X

Irene Realyta Halldy Trosi Tangkawarow, Stralen Pratasik, Maria Rina Rumengan
article en

Abstract

Social media has become an important space for expressing opinions and support during the 2024 Indonesian Presidential Election. However, identifying political support from tweets is challenging because positive or negative expressions do not necessarily indicate support for or rejection of a candidate. This study aims to identify patterns of support for the 2024 presidential candidates using the K-Nearest Neighbor (KNN) method. A total of 1,997 tweets about Prabowo, Anies, and Ganjar were collected from Platform X. The tweets were labeled using rule-based Weak Supervision, combining rules with a lexicon developed for the 2024 presidential election context. After text preprocessing, the data were represented using Term Frequency-Inverse Document Frequency (TF-IDF) and classified with KNN. The dataset was divided into 80% training data and 20% testing data. The model was evaluated using K values of 3, 5, 7, and 9. The best performance was obtained at K = 7, with 91.00% accuracy, 89.48% precision, 91.00% recall, and an 89.24% F1-score. The confusion matrix showed that the model classified neutral tweets more effectively than supporting and non-supporting tweets. These results indicate that KNN with TF-IDF can identify political support patterns, although class imbalance remains a challenge, particularly for minority classes.

ManufakturVol. 4(4)
Manado State University (ID)
Sentiment Analysis and Opinion Mining
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon