Sentiment Analysis of Public Opinion on Hajj Pilgrimage Travel Costs Using the K-Nearest Neighbors (KNN) Method - Rahman, Zeinor; Haryono, Haryono; Hidayat, Rachmad (Universitas Trunojoyo Madura, 2025)
In the context of Islam, humans have the duty to educate themselves, purify their souls, and control their desires. Worship performed with sincerity and pure faith is considered a blessing. One example of worship in Islam is performing the Hajj pilgrimage, which is one of the five pillars of Islam, along with the declaration of faith (shahada), prayer (salat), almsgiving (zakat), and fasting (sawm). Hajj requires self-control, dedication, and sacrifice, including financial resources (Noor, 2018). However, the cost of the Hajj pilgrimage, proposed by the Ministry of Religious Affairs (Kemenag), is set to increase by almost 100% from the previous year, reaching IDR 69 million per person in 2023, eliciting various responses from the public. Some responses are constructive and positive, while others oppose the increase. Sentiment analysis is the method used to analyze public reactions to this change. Data for sentiment analysis was gathered from Twitter, with tweets processed using the Tf-Idf and Tf-Rf word weighting methods. The K-Nearest Neighbors (KNN) algorithm was then employed to assess the accuracy and effectiveness of these methods. The study findings revealed that the Tf-Idf word weighting method outperformed Tf-Rf in categorizing public sentiment regarding the cost of the Hajj pilgrimage. Tf-Idf achieved 84% accuracy, 81% precision, and 79% recall, while Tf-Rf achieved 79% accuracy, 75% precision, and 77% recall. Tf-Idf is considered superior in this sentiment analysis, providing precise predictions while effectively capturing important sentiments. Therefore, this method is deemed a reliable choice for accurate sentiment analysis