Claim Missing Document
Check
Articles

Found 1 Documents
Search
Journal : The Indonesian Journal of Computer Science

Comparative Analysis of Naïve Bayes and K-NN Methods on Social Media Boycott Issue X Case Study: McDonald’s Azzahra, Morra Fatya Gisna Nourielda; Vitianingsih, Anik Vega; Cahyono, Dwi; Maukar, Anastasia Lidya; Badri, Fawaidul
The Indonesian Journal of Computer Science Vol. 14 No. 5 (2025): The Indonesian Journal of Computer Science
Publisher : AI Society & STMIK Indonesia

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.33022/ijcs.v14i5.4956

Abstract

The boycott movement against McDonald’s, triggered by its alleged support for Israel during the conflict in Gaza, has generated significant public discourse, particularly on the social media platform X (formerly Twitter). This study investigates public sentiment regarding the boycott campaign by analyzing comments and reactions to related content. A total of 1,585 tweets were collected using techniques for web scraping and underwent a comprehensive pre-processing phase, encompassing cleaning, tokenization, filtering, and stemming. Sentiment categories, namely positive, neutral, and negative, are automatically assigned using a lexicon-based technique customized for the Indonesian language. Text data was transformed into numerical form through the Term Frequency-Inverse Document Frequency (TF-IDF) technique, followed by sentiment classification using two supervised machine learning algorithms: Naïve Bayes and K-Nearest Neighbor (K-NN). Evaluation of both models was conducted using a confusion matrix and classification metrics. The results show that the dataset is highly imbalanced, with 93.5% of the tweets labelled as negative, 6.1% as neutral, and only 0.3% as positive. The K-NN model achieved better performance than Naïve Bayes (NB), with an accuracy of 93%, a precision of 31%, a recall of 33%, and an F1-score of 32%. On the other hand, the Naïve Bayes algorithm reached 39% accuracy, 33% precision, 29% recall, and an F1-score of 22%. These findings highlight the dominance of negative sentiment toward McDonald’s and demonstrate the efficacy of the K-NN algorithm in sentiment classification in unbalanced datasets. The insights from this study can inform public relations strategies and corporate reputation management in the face of socio-political controversies.
Co-Authors ABDULLAH FAQIH Adimas Ryandanu Ahmad Murtaqi Al Ikhwan Resqy Fauzan Alqob Alawi, Ahmad Albarady, Muhammad Adiestha Alvilda Delsyia Putri Alvin Setiawan Anang Habibi Anastasia Lidya Maukar Anik Vega Vitianingsih Annisa, Faradilla Nur Ardiansyah Siregar Ardiansyah Siregar Awang Andhyka Azzahra, Morra Fatya Gisna Nourielda Azzaro, Nabila Bambang Minto Budiarti, Rizqi Putri Nourma Deny Rusdianto Dujjah, Nurul Ilmi Badrun DWI CAHYONO Efendi S Wirateruna Eko Mulyanto Yuniarno Erina Hanifah Sari Fandisya Rahman Faradilla Nur Annisa Fatimat Uzahro Ferdyanto Hartoko, Rafif Pudyo Hawia, Siti Imam Rosadi Khusnul Khotimah Lina Dwi Novita Sari M. Taqijuddin Alawiy Madia, Niswatul Maulani, Maghfira Izzani Moh Ridwan Mohamat Imron Mohammad Agustian Mohammad Jasa Afroni Muhammad Farih Al Habib Muhammad Taqiyyuddin Alawiy Muhammad Yusuf Niqris Nabila Azzaro Nabilatul Fikriyah Ngatmari Nila Nur Pratiwi Niqris, Muhammad Yusuf Nopia, Rambu Ade Novita Sari Nurullah, Zulfa Putria Nury Maela Adhima Oktrison, Oktrison Oktriza Melfazen Pradina Dyah Widyawan Putra, Rikko Nur Alif Hidayah Permana Qolbi Firmansyah Rafif Pudyo Hartoko Rambu Ade Nopia Ridwan Maulana Riski Mono Sari Rofi, Ahmad Nafiur Saputra, Herdian Saputri , Nanda Sari, Lina Dwi Novita Sari, Nur Farhania Silva, Virginia Amelia Dos Santos Sipahutar , Erwinsyah Siti Hawia Sulistya Umie Ruhmana Sari, Sulistya Umie Ruhmana Syaad Patmanthara Trisna Wati Sakka Uzahro, Fatimat Whardana, Dicky Kusuma Zaeni, Ilham Ari Elbaith Zulfa Putria Nurullah