Sentiment Analysis of Public Opinion on BAWASLU Using Random Forest and Particle Swarm Optimization

Purpose: Sentiment analysis, commonly referred to as opinion mining, involves the study of people's opinions, emotions, and attitudes toward various subjects. While the Random Forest algorithm is frequently employed in sentiment classification tasks, its integration with Particle Swarm Optimization (PSO) for feature selection remains relatively underexplored. This study investigates whether PSO-based feature selection can enhance the predictive performance of Random Forest by optimizing the selection of relevant textual features, ultimately leading to more accurate sentiment classification. Methods: The research adopts a structured text preprocessing approach that includes data cleansing, case folding, normalization, stop-word removal, and stemming to refine the input text. Term Frequency-Inverse Document Frequency (TF-IDF) is applied to extract features, followed by PSO-driven feature selection to refine the input set for the Random Forest classifier. The proposed model is evaluated using a Twitter sentiment dataset related to “Bawaslu”, with performance measured based on Out-of-Bag (OOB) error and accuracy metrics. Result: Empirical results demonstrate that incorporating PSO-based feature selection into the Random Forest model substantially lowers the OOB error to 20.42%, compared to 28.72% in the baseline Random Forest model. Furthermore, the optimized model achieves an accuracy of 78.35%, outperforming the standard approach. However, the introduction of PSO-based feature selection increases computational demands, indicating a trade-off between classification accuracy and processing efficiency. Novelty: This study introduces the novel integration of PSO-driven feature selection with Random Forest classification for sentiment analysis, addressing challenges in imbalanced text data. By optimizing feature selection through a metaheuristic approach, it enhances model accuracy and efficiency. The novelty lies in applying PSO to refine feature selection in text classification, offering new insights into improving machine learning models for imbalanced datasets. Future research could explore reducing computational overhead and investigating hybrid selection techniques to further enhance scalability and performance.

Authors

Institutions

Publication Details

Journal
Scientific Journal of Informatics
Published
2025-06-21
DOI
https://doi.org/10.15294/sji.v12i1.22234
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
article

Sentiment Analysis of Public Opinion on BAWASLU Using Random Forest and Particle Swarm Optimization

Muhammad Farhan, Meida Cahyo Untoro
Scientific Journal of Informatics
Sentiment Analysis and Opinion Mining
article

Sentiment Analysis of Public Opinion on BAWASLU Using Random Forest and Particle Swarm Optimization

Muhammad Farhan, Meida Cahyo Untoro
article en

Abstract

Purpose: Sentiment analysis, commonly referred to as opinion mining, involves the study of people's opinions, emotions, and attitudes toward various subjects. While the Random Forest algorithm is frequently employed in sentiment classification tasks, its integration with Particle Swarm Optimization (PSO) for feature selection remains relatively underexplored. This study investigates whether PSO-based feature selection can enhance the predictive performance of Random Forest by optimizing the selection of relevant textual features, ultimately leading to more accurate sentiment classification. Methods: The research adopts a structured text preprocessing approach that includes data cleansing, case folding, normalization, stop-word removal, and stemming to refine the input text. Term Frequency-Inverse Document Frequency (TF-IDF) is applied to extract features, followed by PSO-driven feature selection to refine the input set for the Random Forest classifier. The proposed model is evaluated using a Twitter sentiment dataset related to “Bawaslu”, with performance measured based on Out-of-Bag (OOB) error and accuracy metrics. Result: Empirical results demonstrate that incorporating PSO-based feature selection into the Random Forest model substantially lowers the OOB error to 20.42%, compared to 28.72% in the baseline Random Forest model. Furthermore, the optimized model achieves an accuracy of 78.35%, outperforming the standard approach. However, the introduction of PSO-based feature selection increases computational demands, indicating a trade-off between classification accuracy and processing efficiency. Novelty: This study introduces the novel integration of PSO-driven feature selection with Random Forest classification for sentiment analysis, addressing challenges in imbalanced text data. By optimizing feature selection through a metaheuristic approach, it enhances model accuracy and efficiency. The novelty lies in applying PSO to refine feature selection in text classification, offering new insights into improving machine learning models for imbalanced datasets. Future research could explore reducing computational overhead and investigating hybrid selection techniques to further enhance scalability and performance.

Scientific Journal of InformaticsVol. 12(1)
Sumatera Institute of Technology (ID)
Life in Land
Openalex Percentile: Top 93%
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.