This study aims to analyze public sentiment regarding Masjid Raya An-Nur in Riau Province using a machine learning stacking technique. Visitor reviews collected from Google Maps are classified into three categories: Facilities, Cleanliness, and Security. The research applies several preprocessing stages including cleaning, normalization, and tokenization, followed by TF-IDF weighting. To address class imbalance, SMOTE is used before the training process. Three base models—K-Nearest Neighbors (KNN), Decision Tree (DT), and Multinomial Naïve Bayes (MNB)—are trained, and their outputs are combined using Logistic Regression as the meta-classifier in a stacking ensemble. The results show that the stacking model outperforms the individual models with an accuracy of 94%, compared to 73% for KNN, 92.8% for DT, and 83.8% for MNB. The stacking technique provides high and balanced precision, recall, and F1-scores across all sentiment categories. This approach demonstrates the effectiveness of ensemble learning in improving sentiment classification performance for unstructured textual data. The findings are expected to help mosque administrators gain deeper insights into public perceptions and enhance service quality.
Copyrights © 2025