Komparasi Metode Naïve Bayes, Random Forest dan KNN untuk Analisis Sentimen Penambangan Nikel - Setiyana, Beta Agus; Suryono, Ryan Randy (Forum Kerjasama Pendidikan Tinggi, 2025)
The phenomenon of increasing natural resource exploitation in Indonesia’s conservation areas has raised significant public concern, one of which involves the planned nickel mining project in Raja Ampat, a region renowned for its extraordinary marine biodiversity. This plan has sparked debates between economic interests, environmental preservation, and the sociocultural values of local communities. Amid the growing public discourse, social media has become a major platform for people to express their opinions, support, or opposition toward mining activities. This study aims to map public sentiment regarding the nickel mining issue in Raja Ampat by analyzing 5,556 Indonesian-language tweets collected from the social media platform X using the keyword “save raja ampat” between January- June 2025. The data underwent several preprocessing stages, including cleaning, case folding, tokenizing, stopword removal, and normalization, and were then represented using the TF-IDF method. Sentiment labeling was performed semi automatically using a lexicon based approach into three categories: positive, neutral, and negative. The sentiment distribution showed dominance of neutral (72.9%), followed by negative (24.3%) and positive (2.8%), indicating class imbalance. To address this issue, the SMOTE technique was applied to the training data. Three classical algorithms K-Nearest Neighbor (KNN), Complement Naïve Bayes (CNB), and Random Forest (RF) were compared using cross-validation and holdout testing with accuracy, precision, recall, and F1-score as evaluation metrics. The results show that CNB performed most stably before SMOTE, while after SMOTE, KNN demonstrated significant improvement, especially in recall and macro F1-score. These findings confirm that the combination of data balancing techniques and classical algorithms remains relevant and efficient as a methodological baseline for public sentiment analysis on complex environmental issues such as nickel mining in Raja Ampat.