Implementing TF-IDF and Logistic Regression for Sentiment Analysis of YouTube Comments on the iPhone 16 - Andi Riswawan (JURNAL TEKNOLOGI DAN OPEN SOURCE, 2025)
Sentiment analysis of user opinions on social media has become a crucial aspect in understanding public perception of technological products. This study specifically aims to classify and analyze public sentiment reflected in YouTube comments regarding the iPhone 16 by employing the Term Frequency-Inverse Document Frequency (TF-IDF) approach and the Logistic Regression algorithm. The data was collected from product review videos on the GadgetIn channel using web scraping techniques.The preprocessing stage included cleaning processes such as converting characters to lowercase (case folding), removing common words that do not carry sentiment meaning (stopword removal), and reducing words to their root forms (stemming). The feature extraction results obtained through TF-IDF were used as input for the Logistic Regression model to classify the comments into three categories of emotional expression: positive (supportive), neutral, and negative sentiments toward the discussed topic. The model’s effectiveness was evaluated using accuracy, precision, recall, and F1-score metrics. Based on the evaluation results, the model demonstrated a reasonably optimal performance in classifying user opinions. The findings indicate that the model performs with stability and accuracy in handling high-dimensional sentiment data. This research contributes to the development of text-based sentiment classification systems in the context of technology review analysis.