Analisis Sentimen X Terhadap Pemilihan Presiden Indonesia 2024 dengan Metode K-Nearest Neighbor
Abstract
The presidential election which will take place in 2024, sentiment analysis is carried out to determine the tendency of a person's opinion towards an event or problem, whether it tends to be positive or negative. The purpose of this study is to apply the K-Nearest Neighbor Algorithm to the classification of public opinion on the 2024 presidential election and produce a classification of the application of the K-Nearest Neighbor algorithm method to public opinion on the 2024 presidential election on social media X. Based on the results of the research that has been done, it can be concluded that sentiment analysis using the K-Nearest Neighbor (KNN) method has proven effective in identifying and understanding public sentiment related to the 2024 Indonesian presidential election. The community's response to the phenomenon of trends and public opinion towards prospective presidential candidates in 2024 is considered to show a positive attitude, as illustrated in sentiment analysis using a lexicon dictionary. Of the approximately 1,000 tweets that have been analyzed, 211 of them show a positive sentiment, 175 express a negative sentiment, while the other 614 express a Neutral sentiment. This data was collected from November 28, 2023 to April 28, 2024. In addition, this study also identified words that frequently appear in Indonesian tweets. In K-Nearest Neighbor (KNN), the results obtained by the accuracy of the use training set get an accuracy of 100%, precision of 100%, recall of 100% and f-measure of 100%, 10-fold cross validation obtained get an accuracy of 92.5%, precision of 100% recall of 91% and f-measure of 94%, and the last 80% percentage split get an accuracy of 88.55%, precision of 100%, recall of 87% and f-measure of 93.04%. The K-Nearest Neighbor (K-NN) algorithm classification method using 80% percentage split testing is very good in classification testing has greater accuracy, precision, recall and f-measure compared to 10-fold cross validation testing.
Downloads
References
I. Kurniawan and A. Susanto, “Implementasi Metode K-Means dan Naïve Bayes Classifier untuk Analisis Sentimen Pemilihan Presiden (Pilpres) 2019,” Eksplora Informatika, vol. 9, no. 1, pp. 1–10, Sep. 2019, doi: 10.30864/eksplora.v9i1.237.
T. Rosyida, H. P. Putro, and H. Wahyono, “Analisis Sentimen Terhadap Pilpres 2024 Berdasarkan Opini dari Twitter Menggunakan Naive Bayes dan SVM,” Teknokris, vol. 26, no. 1, pp. 23–32, 2023
A. Malik Zuhdi, E. Utami, and S. Raharjo, “Analisis Sentiment Twitter Terhadap Capres Indonesia 2019 Dengan Metode K-NN,” Jurnal INFORMA Politeknik Indonusa Surakarta, vol. 5, no. 2, pp. 1–7, 2019.
F. A. Wenando, R. Hayami, and A. J. Anggrawan, “Analisis Sentimen Pada Pemerintahan Terpilih Pada Pilpres 2019 Di Twitter Menggunakan Algoritma NaiveBayes,” JURTEKSI (Jurnal Teknologi dan Sistem Informasi), vol. 7, no. 1, pp. 99–104, Dec. 2020, doi: 10.33330/jurteksi.v7i1.851.
F. R. Irawan, A. Jazuli, and T. Khotimah, “ANALISIS SENTIMEN TERHADAP PENGGUNA GOJEK MENGGUNAKAN METODE K-NEARSET NEIGHBORS,” Jurnal Informatika dan Komputer) Akreditasi KEMENRISTEKDIKTI, vol. 5, no. 1, 2022, doi: 10.33387/jiko.
Reddy, “Analisis Sentimen Pengguna Twitter Terhadap Polemik Persepakbolaan Indonesia Menggunakan Pembobotan TF-IDF dan K-Nearest Neighbor”, 2020
M. Furqan, and S. Mayang Sari “Analisis Sentimen Menggunakan K-Nearest Neighbor Terhadap New Normal Masa Covid-19 Di Indonesia”, 2022
D. Eka Ratnawati, “Analisis Sentimen berbasis Aspek terhadap Data Ulasan menggunakan Metode K-Nearest Neighbor (Studi Kasus: Aplikasi Olsera POS),” 2023. [Online]. Available: http://j-ptiik.ub.ac.id
J. A. Samudra, S. Anraeni, and D. Herman, “Penerapan Metode K-Nearest Neighbor untuk Memprediksi Tingkat Kelulusan Mahasiswa Berbasis Web pada Fakultas Ilmu Komputer UMI,” vol. 1, no. 4, pp. 230–237, 2020.
D. Agustina and F. Rahmah, “Analisis Sentimen pada Sosial Media Twitter terhadap MRT Jakarta Menggunakan Machine Learning,” Insearch, vol. 2, no. 1, pp. 1–6, 2022.
R. Mustaqilah, O. Widyaningtyas, and T. Wantoro, “Efektivitas Penggunaan Twitter Sebagai Sarana Peningkatan Berpikir Kritis Mahasiswa Ilmu Komunikasi,” MUKASI: Jurnal Ilmu Komunikasi, vol. 2, no. 1, pp. 18–28, 2023, doi: 10.54259/mukasi.v2i1.1346.
M. J. Aridiyanto and P. Penagsang, “Analisis Faktor-Faktor Yang Mempengaruhi Kinerja Koperasi (Studi Kasus : Koperasi di Surabaya Utara),” Jurnal Ekonomi dan Bisnis, vol. 7, no. 1, pp. 27–40, 2022.
A. Halim, Y. Yusra, M. Fikry, M. Irsyad, and E. Budianita, “Klasifikasi Sentimen Masyarakat Di Twitter Terhadap Prabowo Subianto Sebagai Bakal Calon Presiden 2024 Menggunakan M-KNN,” Journal of Information System Research (JOSH), vol. 5, no. 1, pp. 202–212, 2023, doi: 10.47065/josh.v5i1.4054.
A. F. Sabily, P. P. Adikara, and M. A. Fauzi, “Analisis Sentimen Pemilihan Presiden 2019 pada Twitter menggunakan Metode Maximum Entropy,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 3, no. 5, pp. 4204–4209, 2019.
Z. Mahendra and A. Ridok, “Analisis Sentimen Opini Masyarakat Terhadap Fenomena TikTokShop di Indonesia Menggunakan Metode K-Nearest Neighbor berbasis N-gram dengan Seleksi Fitur Information Gain,” vol. 1, no. 1, pp. 1–10, 2022.
I. Indriati and A. Ridok, “Sentiment Analysis for Review Mobile Applications Using Neighbor Method Weighted K-Nearest Neighbor (Nwknn),” Journal of Enviromental Engineering and Sustainable Technology, vol. 3, no. 1, pp. 23–32, 2021, doi: 10.21776/ub.jeest.2016.003.01.4.
S. Abdullah, “Penulis Pertama: Visualisasi Data Analisa Sentimen … 261 Visualisasi Data Analisa Sentimen RUU Omnibus law Kesehatan Menggunakan KNN dengan Software RapidMiner,” vol. 8, no. 3, 2023.
I. Mulia and M. Muanas, “Model Prediksi Kelulusan Mahasiswa Menggunakan Decision Tree C4.5 dan Software Weka,” JAS-PT (Jurnal Analisis Sistem Pendidikan Tinggi Indonesia), vol. 5, no. 1, pp. 57–64, Jun. 2021, doi: 10.36339/jaspt.v5i1.417.
I. Nawangsih, I. Melani, S. Fauziah, and A. I. Artikel, “Pelita Teknologi Prediksi Pengangkatan Karyawan Dengan Metode Algoritma C5.0 (Studi Kasus Pt. Mataram Cakra Buana Agung,” Jurnal Pelita Teknologi, vol. 16, no. 2, pp. 24–33, 2021.
G. F. Grandis, Y. Arumsari, and Indriati, “Seleksi Fitur Gain Ratio pada Analisis Sentimen Kebijakan Pemerintah Mengenai Pembelajaran Jarak Jauh dengan K-Nearest Neighbor,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 5, no. 8, pp. 3507–3514, 2021.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Sentimen X Terhadap Pemilihan Presiden Indonesia 2024 dengan Metode K-Nearest Neighbor
Pages: 1064-1078
Copyright (c) 2024 Tri Allan Siddiq, Muhammad Ikhsan

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).






















