IMPLEMENTASI ALGORITMA K-NEAREST NEIGHBOR UNTUK MENGANALISIS SENTIMEN USER TWITTER
No Thumbnail Available
Date
2021-12
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Elfitra
Abstract
Twitter is a frequently used social media that is used to state opinions whether it is
positive or negative. The purpose of this research is to analyze the sentiment of Twitter
users regarding an issue. The case study for this research is the incident of Tol
Cikampek. The data that is proper to use for sentiment analysis are 618 data tweets
which consists of 237 positive data tweets and 389 negative data tweets taken during
December-January 2021 using Twint application in Python. Data tweets that are taken
goes through pre-processing stage which consists of case folding, data cleansing,
tokenization, normalization, stopword removal, and stemming. After pre-processing,
data weighting is done using Term Frequency-Inverse Document Frequency (TF-IDF)
and classification is done using the method of K-Nearest Neighbor with cosine
similarity to calculate the distance between documents. Based on the evaluation results
using confusion matrix, the highest accuracy is 83,1% when k=9, the highest precision
2
is 66,7% when k=5 and the highest recall is 87,5% when k=9.
Description
Keywords
Sentiment Analysis, K – Nearest Neighbor, TF-IDF, Cosine Similarity, Confusion Matrix
Citation
Perpustakaan