Assessing Twitter User Sentiment Regarding Divorce Issues Using the Random Forest Method

Authors

  • Muhamad Azwar Universitas Bumigora, Mataram, Indonesia
  • I Putu Hariyadi Universitas Bumigora, Mataram, Indonesia
  • Raisul Azhar Universitas Bumigora, Mataram, Indonesia

DOI:

https://doi.org/10.30812/ijecsa.v4i2.4980

Keywords:

Sentiment Analysis, Divorce, Random Forest, Confusion Matrix

Abstract

The issue of divorce remains a complex and sensitive topic within Indonesian society, influenced by various factors such as repeated disputes, domestic violence, lack of harmony, financial difficulties, and other socio-cultural aspects. With the rise of social media, particularly Twitter, public discussions regarding divorce have become more widespread, allowing individuals to express their opinions and sentiments on the subject. These diverse perspectives create a wealth of sentiment data that can be analyzed to understand public perception and societal trends related to divorce. This study aims to classify public sentiment on divorce-related discussions using the Random Forest algorithm, providing insight into how people perceive and react to divorce issues. The research adopts a quantitative approach with a case study framework. The methodology involves data collection through web scraping techniques to gather approximately 1500 tweets containing discussions on divorce. The collected data is then preprocessed, including text cleaning, tokenization, and feature extraction, before being used to train and evaluate the Random Forest model. Sentiments are classified into three categories: negative, neutral, and positive. The classification model's performance is assessed using accuracy and F1-score metrics derived from the confusion matrix to determine its effectiveness in categorizing sentiments. Experimental results indicate that the Random Forest algorithm achieves an accuracy of 70%. The relatively low accuracy is attributed to the imbalance in sentiment class distribution, where negative sentiments dominate while positive sentiments are underrepresented. This imbalance affects the model's ability to predict positive sentiments effectively. The implications of this research contribute to a better understanding of public sentiment dynamics regarding divorce, which can be beneficial for policymakers, psychologists, and social researchers in analyzing societal attitudes towards marital dissolution.

References

[1] Q. Ainiyah and I. Muslih, “Dilema Hukum Keluarga Di Indonesia (Studi Analisis Kasus Perceraian di Indonesia),” J. Istiqro, vol. 6, no. 1, pp. 73–81, 2020, doi: 10.30739/istiqro.v6i1.560.

[2] R. Puspita and A. Widodo, “Analisis Sentimen terhadap Layanan Indihome di Twitter dengan Metode Machine Learning,” J. Inform. Univ. Pamulang, vol. 6, no. 4, pp. 759–766, 2021.

[3] S. M. Fani, R. Santoso, and S. Suparti, “Penerapan Text Mining Untuk Melakukan Clustering Data Tweet Akun Blibli Pada Media Sosial Twitter Menggunakan K-Means Clustering,” J. Gaussian, vol. 10, no. 4, pp. 583–593, 2021, doi: 10.14710/j.gauss.v10i4.30409.

[4] M. R. Santoso and P. Musa, “Rekomendasi Kesehatan Janin Dengan Penerapan Algoritma C5.0 Menggunakan Classifying Cardiotocography Dataset,” J. Simantec, vol. 9, no. 2, pp. 65–76, 2021, doi: 10.21107/simantec.v9i2.10730.

[5] A. N. Nurkalyisah, A. Triayudi, and I. D. Sholihati, “Analisis Sentimen pada Twitter Berbahasa Indonesia Terhadap Penurunan Performa Layanan Indihome dan Telkomsel,” J. Sist. dan Teknol. Inf., vol. 10, no. 4, pp. 387–394, 2022, doi: 10.26418/justin.v10i4.50858.

[6] A. R. Dewi, S. Diana, M. A. Fakhrezi, N. Awang, H. Ma’arif, and D. D. Saputra, “Sentimen Analisis Terhadap Puan Maharani Sebagai Kandidat Calon Presiden 2024 Berdasarkan Opini Twitter Menggunakan Metode Naive Bayes Dan Adaboost,” JSiI (Jurnal Sist. Informasi), vol. 10, no. 1, pp. 75–80, 2023, doi: 10.30656/jsii.v10i1.5785.

[7] K. E. Linadi, “Pelatihan Pembelajaran Interaktif untuk Pelaksana Kelas Persiapan Pernikahan di Kecamatan Sambi Boyolali,” Indones. J. Community Dedication Heal., vol. 3, no. 2, pp. 54–60, 2023, doi: 10.30587/ijcdh.v3i02.4956.

[8] U. Indahyanti, N. L. Azizah, and H. Setiawan, “Pendekatan Ensemble Learning Untuk Meningkatkan Akurasi Prediksi Kinerja Akademik Mahasiswa,” J. Sains dan Inform., vol. 8, no. 2, 2022, doi: 10.34128/jsi.v8i2.459.

[9] Y. Tambing, “Prototype Sistem Kontrol Lampu Berbasis Internet Of Things ( Iot ) Menggunakan Nodemcu,” J. Inform. dan Tek. Elektro Terap., vol. 12, no. 1, pp. 266–274, 2024, doi: 10.23960/jitet.v12i1.3702.

[10] G. Tamboto, Q. C. Kainde, and V. P. Rantung, “Aplikasi Reservasi Layanan Rumah Sakit Berbasis Android Menggunakan Metode Spiral,” J. Indones. Sos. Teknol., vol. 4, no. 5, pp. 556–569, 2023, doi: 10.59141/jist.v4i5.616.

[11] Y. MZ, J. Bororing Edwin, S. Rahayu, and J. F Andhika, “Analisis Sentimen Terhadap Layanan Tokopedia Berdasarkan Twitter dengan Metode Klasifikasi Support Vector Machine,” Smart Comp Jurnalnya Orang Pint. Komput., vol. 12, no. 1, pp. 153–163, 2023, doi: 10.30591/smartcomp.v12i1.4591.

[12] D. Surya Prasetyo, K. Auliasari, and M. Ridho Putra Syalabi, “Klasifikasi Serangan Jaringan Menggunakan Metode K-Nearest Neighbour pada Data Riwayat Jaringan,” Pros. SENIATI, vol. 7, no. 1, pp. 63–71, 2023, doi: 10.36040/seniati.v7i1.7874.

[13] R. Kosasih and A. Alberto, “Sentiment analysis of game product on shopee using the TF-IDF method and naive bayes classifier,” Ilk. J. Ilm., vol. 13, no. 2, pp. 101–109, 2021, doi: 10.33096/ilkom.v13i2.721.101-109.

[14] X. Shi, Z. Zhang, X. Qiu, and Z. Luo, “Experiment Study of Stemming Length and Stemming Material Impact on Rock Fragmentation and Dynamic Strain,” Sustain., vol. 15, no. 17, pp. 1–20, 2023, doi: 10.3390/su151713024.

[15] Rianto, A. B. Mutiara, E. P. Wibowo, and P. I. Santosa, “Improving the accuracy of text classification using stemming method, a case of non-formal Indonesian conversation,” J. Big Data, vol. 8, no. 1, pp. 1–16, 2021, doi: 10.1186/s40537-021-00413-1.

[16] Pratibha, A. Kaur, M. Khurana, and R. Damaševičius, “Multimodal Hinglish Tweet Dataset for Deep Pragmatic Analysis,” Data, vol. 9, no. 2, 2024, doi: 10.3390/data9020038.

[17] C. Michael Lauw, H. Hairani, I. Saifuddin, J. Ximenes Guterres, M. Maariful Huda, and M. Mayadi, “Combination of Smote and Random Forest Methods for Lung Cancer Classification,” Int. J. Eng. Comput. Sci. Appl., vol. 2, no. 2, pp. 59–64, Sep. 2023, doi: 10.30812/ijecsa.v2i2.3333.

[18] A. Ahmad and W. Gata, “Sentimen Analisis Masyarakat Indonesia di Twitter Terkait Metaverse dengan Algoritma Support Vector Machine,” J. JTIK (Jurnal Teknol. Inf. dan Komunikasi), vol. 6, no. 4, pp. 548–555, 2022, doi: 10.35870/jtik.v6i4.569.

[19] O. P. Zusrotun, A. C. Murti, and R. Fiati, “Analisis Sentimen Terhadap Belajar Online pada Media Sosial Twitter Menggunakan Algoritma Naive Bayes,” J. Nas. Pendidik. Tek. Inform., vol. 11, no. 3, pp. 1642–1649, 2022, doi: 10.23887/janapati.v11i3.49160.

[20] I. N. Switrayana, D. Ashadi, H. Hairani, and A. Aminuddin, “Sentiment Analysis and Topic Modeling of Kitabisa Applications using Support Vector Machine (SVM) and Smote-Tomek Links Methods,” Int. J. Eng. Comput. Sci. Appl., vol. 2, no. 2, pp. 81–91, Sep. 2023, doi: 10.30812/ijecsa.v2i2.3406.

[21] H. Hairani, M. Janhasmadja, A. Tholib, J. X. Guterres, and Y. Ariyanto, “Thesis Topic Modeling Study : Latent Dirichlet Allocation ( LDA ) and Machine Learning Approach,” Int. J. Eng. Comput. Sci. Appl., vol. 3, no. 2, pp. 51–60, 2024, doi: 10.30812/ijecsa.v3i2.4375.Journal.

Downloads

Published

2025-07-02

How to Cite

[1]
Muhamad Azwar, I Putu Hariyadi, and Raisul Azhar, “Assessing Twitter User Sentiment Regarding Divorce Issues Using the Random Forest Method”, IJECSA, vol. 4, no. 2, pp. 71–80, Jul. 2025, doi: 10.30812/ijecsa.v4i2.4980.