Jurnal Informatika dan Rekayasa Perangkat Lunak
Vol. 7 No. 2 (2025): September

Model Klasifikasi Emosi Berbasis Teks dengan Algoritma Decision Tree dan Support Vector Machine

Raihan, Habib Aulia (Unknown)
Yuliansyah, Herman (Unknown)
Murinto (Unknown)



Article Info

Publish Date
30 Sep 2025

Abstract

Text-based communication has become a key means of interaction across various sectors. Previous studies have applied supervised learning algorithms to emotion classification in text. These studies used different datasets, but this diversity also introduced a risk of overfitting in text-based emotion classification models. Consequently, the use of cross-validation and hyperparameter optimization is required to ensure the model’s generalization ability. The aim of this research is to compare the performance of two supervised learning algorithms—Decision Tree (DT) and Support Vector Machine (SVM)—for emotion classification on an English-language text dataset of 16,000 labeled entries (anger, fear, joy, love, sadness, surprise) sourced from Kaggle. The dataset undergoes cleaning, tokenization, stopword removal, and lemmatization, after which features are extracted using TF-IDF. Both algorithms are evaluated with K-Fold and Stratified K-Fold cross-validation, then used to compute metrics of accuracy, precision, recall, and F1-score. Classification results show that the hyperparameter-tuned DT achieved an average accuracy of 88%, while the hyperparameter-tuned SVM achieved 89%. Meanwhile, Stratified K-Fold cross-validation yielded an accuracy variance of just 0.02% for DT and 0.15% for SVM. Therefore, it can be concluded that Stratified K-Fold performs better than standard K-Fold on imbalanced datasets, and that hyperparameter-tuned SVM outperforms hyperparameter-tuned DT.

Copyrights © 2025






Journal Info

Abbrev

JINRPL

Publisher

Subject

Computer Science & IT

Description

Journal of Informatics and Software Engineering accepts scientific articles in the focus of Informatics. The scope can be: Software Engineering, Information Systems, Artificial Intelligence, Computer Based Learning, Computer Networking and Data Communication, and ...