Comparison of Random Forest and XGBoost in Public Opinion Classification towards Danantara on Platform X

Comparison of Random Forest and XGBoost in Public Opinion Classification towards Danantara on Platform X

Authors

  • Siti Sarah Nabila Informatics Engineering department, Universitas Sebelas April
  • Dody Herdiana Universitas Sebelas April
  • Muhammad Agreindra Helmiawan

Keywords:

Danantara, NLP, Random Forest, Sentiment Analysis, Social Media X, XGBoost

Abstract

Danantara Indonesia is an investment management agency under Daya Anagata Nusantara aimed at increasing state investment synergy to accelerate national economic growth. The establishment of this institution has attracted significant public attention, sparking various positive and negative views, particularly on the social media platform X. Understanding how public perception is formed in the digital space is crucial as a reflection of public trust in this new institution. To analyze this systematically, this study implements a sentiment analysis method using a Natural Language Processing (NLP) framework. The data, obtained from the Kaggle public repository, consists of tweets related to Danantara. The methodology involves a series of preprocessing stages—including case folding, tokenizing, stopword removal, and stemming—followed by data splitting and feature extraction using the TF-IDF technique. Subsequently, the modeling stage compares two machine learning algorithms: Random Forest and XGBoost, to classify sentiment into positive and negative classes. Model evaluation is performed using Accuracy, Precision, Recall, and F1-Score metrics. The results demonstrate that XGBoost outperforms Random Forest with an accuracy of 93%, compared to 92% for Random Forest. The sentiment distribution is dominated by negative sentiment, reflecting public criticism and concerns regarding the program's implementation.

Published

2026-06-27
Loading...