Along with the development of technological advances, a lot of social media is used by humans, one of which is Twitter social media. On Twitter social media, we can find a lot of text data, opinions and public opinion, as the issue of cooking oil is currently hot in Indonesia. In this study, the K-NN and Random Forest methods were used, and the purpose of this study was to compare the two methods in sentiment analysis on the issue of cooking oil. The results of the accuracy of these two methods are not too far apart. Each of the two methods used will be divided into three research scenarios, the first is scenario 1, a collection of 500 data, scenario 2, a collection of 800 data, and scenario 3, a collection of 1,000 data, where the ratio of training data and test data is 80:20. The test results for the K-NN method in scenario 2 are superior with an accuracy presentation of 74.58%, 56.75% precision and 44.57% recall and the lowest result is the K-NN method scenario 1 with an accuracy presentation of 71. 50%, 47.83% precision and 37.45% recall. The average test results for the K-NN method are 72.86% accuracy, 52.26% precision and 41.04% recall. While the average results of the random forest method are 73.37% accuracy, 52.26% precision and 34.28% recall
Copyrights © 2023