Sentimen Analisis Pengguna Twitter pada Event Flash Sale Menggunakan Algoritma K-NN, Random Forest, dan Naive Bayes

Aprilia Wandani, F Fauziah, A Andrianingsih


There is a sales system called Flash Sale in e-commerce. Basically the concept of a Flash Sale is to offer a lower price and a predetermined time and number of products. The sales system is only held at certain moments, by making cheaper product sales but with a limited time and number of products it will make sales increase because buyer interest will be higher. But apart from all the advantages of course there will be pros and cons. Sentiment analysis on Twitter was chosen because Twitter itself is a social media that allows users to be free to comment or write opinions about anything, including opinions about flash sale events that exist in e-commerce today. Thus, this research exists to find out the opinions of existing Twitter users regarding the Flash Sale event held by e-commerce. By using the methodology of three classification algorithms, Naive Bayes, K-Nearest Neighbor and Random Forest in classifying the data to determine the accuracy of the sentiment value of Twitter users in the Flash Sale event. This research takes two data samples from the keywords "flash sale" and "flash sale shopee", the results accuracy of the implementation of the three classification algorithms are 83.53% Naive Bayes, 82.94% K-NN, 80.59% Random Forest for the keyword "flash sale” and 81.48% Naive Bayes, 77.78% K-NN, 74.07% Random Forest for the keyword “flash sale shopee”. With this, the Naive Bayes Algorithm becomes a recommendation for classifying Sentiment Analysis data with greater accuracy and more stability to be used for large and small data.

Full Text:



A. Rasool, R. Tao, K. Marjan, and T. Naveed, “Twitter Sentiment Analysis : A Case Study for Apparel Brands Twitter Sentiment Analysis : A Case Study for Apparel Brands,” IOP Conf. Ser. J. Phys. Conf. Ser., 2019, doi: 10.1088/1742-6596/1176/2/022015.

A. M. Khattak et al., “Tweets classification and sentiment analysis for personalized tweets recommendation,” Complexity, vol. 2020, 2020, doi: 10.1155/2020/8892552.

C. Bhagat and D. Mane, “Survey On Text Categorization Using Sentiment Analysis,” vol. 8, no. 08, 2019.

I. M. Noor and M. Turan, “Sentiment Analysis using Twitter Dataset,” IJID (International J. Informatics Dev., vol. 9, no. 2, pp. 84–94, 2020, doi: 10.14421/ijid.2019.08206.

A. Shelar and C. Y. Huang, “Sentiment analysis of twitter data,” Proc. - 2018 Int. Conf. Comput. Sci. Comput. Intell. CSCI 2018, pp. 1301–1302, 2018, doi: 10.1109/CSCI46756.2018.00252.

S. Gohil, S. Vuik, and A. Darzi, “Sentiment analysis of health care tweets: Review of the methods used,” JMIR Public Heal. Surveill., vol. 20, no. 4, 2018, doi: 10.2196/publichealth.5789.

M. A. Kausar, A. Soosaimanickam, and M. Nasar, “Public Sentiment Analysis on Twitter Data during COVID-19 Outbreak,” Int. J. Adv. Comput. Sci. Appl., vol. 12, no. 2, pp. 415–422, 2021, doi: 10.14569/IJACSA.2021.0120252.

V. A. and S. S. Sonawane, “Sentiment Analysis of Twitter Data: A Survey of Techniques,” Int. J. Comput. Appl., vol. 139, no. 11, pp. 5–15, 2016, doi: 10.5120/ijca2016908625.

M. Kiruthika, W. Sanjana, and P. Giri, “Sentiment Analysis of Twitter Data,” Int. J. Innov. Eng. Technol., vol. 6, no. 4, pp. 2319–1058, 2016, [Online]. Available:

Y. N and M. S, “A Review on Text Mining in Data Mining,” Int. J. Soft Comput., vol. 7, no. 2/3, pp. 01–08, 2016, doi: 10.5121/ijsc.2016.7301.

K. B. Priya Iyer and S. Kumaresh, “Twitter sentiment analysis on coronavirus outbreak using machine learning algorithms,” Eur. J. Mol. Clin. Med., vol. 7, no. 3, pp. 2663–2676, 2020.

A. P. Giovani, A. Ardiansyah, T. Haryanti, L. Kurniawati, and W. Gata, “Analisis Sentimen Aplikasi Ruang Guru Di Twitter Menggunakan Algoritma Klasifikasi,” J. Teknoinfo, vol. 14, no. 2, p. 115, 2020, doi: 10.33365/jti.v14i2.679.

E. S. Negara, R. Andryani, and P. H. Saksono, “Analisis Data Twitter: Ekstraksi dan Analisis Data G eospasial,” J. INKOM, vol. 10, no. 1, p. 27, 2016, doi: 10.14203/j.inkom.433.

I. Saputra, J. A. Halomoan, A. B. Raharjo, C. Rezky, A. Syavira, and S. Informasi, “SENTIMENT ANALYSIS ON TWITTER OF PSBB EFFECT USING MACHINE,” pp. 143–150.

S. Afrizal, H. N. Irmanda, N. Falih, and I. N. Isnainiyah, “Implementasi Metode Naïve Bayes untuk Analisis Sentimen Warga Jakarta Terhadap Kehadiran Mass Rapid Transit,” J. Inform., vol. 4221, pp. 157–168, 2019.

B. M. Pintoko and K. M. L., “Analisis Sentimen Jasa Transportasi Online pada Twitter Menggunakan Metode Naive Bayes Classifier,” e-Proceeding Eng., vol. 5, no. 3, pp. 8121–8130, 2018.

N. Novalita, A. Herdiani, I. Lukmana, and D. Puspandari, “Cyberbullying identification on twitter using random forest classifier,” J. Phys. Conf. Ser., vol. 1192, no. 1, 2019, doi: 10.1088/1742-6596/1192/1/012029.

S. Goyal, “Review Paper on Sentiment Analysis of Twitter Data Using Text Mining and Hybrid Classification Approach,” Internatio nal J. Eng. Dev. Res., vol. 5, no. 2, pp. 2321–9939, 2017, [Online]. Available:

R. H. Satrio and M. A. Fauzi, “Klasifikasi Tweets Pada Twitter Menggunakan Metode K-Nearest Neighbour ( K-NN ) Dengan Pembobotan TF-IDF,” vol. 3, no. 8, pp. 8293–8300, 2019.

M. Shoeb and J. Ahmed, “Sentiment Analysis and Classification of Tweets Using Data Mining,” Int. Res. J. Eng. Technol., vol. 4, no. 12, pp. 1471–1474, 2017, [Online]. Available:



  • There are currently no refbacks.

J-SAKTI (Jurnal Sains Komputer & Informatika)
Published Papers Indexed/Abstracted By:

Jumlah Kunjungan :

View My Stats