International Journal of Informatics and Computing
Vol. 1 No. 2 (2025): November 2025

Sentiment Analysis of ChatGPT Using the KNN Algorithm and K-Fold Cross-Validation Optimization of the K Value

Azliza Yacob (Unknown)
Nurzal Effiyana Ghazali (Unknown)
Faez M. Hassan (Unknown)



Article Info

Publish Date
21 Nov 2025

Abstract

ChatGPT is a cutting-edge artificial intelligence language model powered by advanced machine learning technologies, such as GPT-4.0. It’s remarkable ability to generate human-like text and engage in interactive conversations has captured widespread attention, particularly on social media. As a result, public sentiment toward ChatGPT has become a significant topic, necessitating detailed sentiment analysis to comprehend the broader societal reactions to this technology. This study focuses on optimizing the K value in sentiment analysis applied to Twitter data about ChatGPT. Selecting the appropriate K value is crucial, as improper values can result in overfitting or underfitting the model. The research methodology includes several stages: data collection, pre-processing, feature extraction, k-fold cross-validation for K optimization, implementing the K-Nearest Neighbors (KNN) algorithm, and evaluating results. The analysis determined that the optimal K value for this sentiment analysis is K=9. Using this value, the KNN algorithm achieved an accuracy of 88%, indicating robust performance in classifying sentiment effectively. These findings highlight the potential of this approach to provide meaningful insights into public perception and sentiment regarding ChatGPT on social media platforms. This result not only underscores the technical effectiveness of KNN for sentiment analysis but also demonstrates the practical application of machine learning in understanding societal trends in the context of emerging AI technologies.

Copyrights © 2025






Journal Info

Abbrev

JICO

Publisher

Subject

Computer Science & IT Electrical & Electronics Engineering

Description

International Journal of Informatics and Computing (JICO) is the official publication of the Institute of Advanced Informatics and Computing (IAICO). The journal is open to submission from scholars and experts in the wide areas of informatics and computing from the global ...