ALGORITMA : JURNAL ILMU KOMPUTER DAN INFORMATIKA
Vol 10, No 1 (2026): April 2026

Komparasi Algoritma KNN Dan SVM Untuk Klasifikasi Kesehatan Mental Pada Usia Remaja

Rizky Hidayat Hasibuan (Universitas Muhammadiyah Sumatera Utara)
Mulkan Azhari (Universitas Muhammadiyah Sumatera Utara)



Article Info

Publish Date
30 Apr 2026

Abstract

Mental health among adolescents is a critical issue that continues to increase and is often not detected early due to the limitations of assessment methods that remain largely subjective. This study aims to classify adolescent mental health levels based on stress levels using a machine learning approach and to compare the performance of the KNN and SVM algorithms. The dataset used consists of 1,100 adolescent records obtained from GitHub, comprising 11 predictor attributes and one target attribute, namely stress_level, which is classified into three categories: low, moderate, and high. The research stages include data preprocessing, EDA, feature selection, handling class imbalance using the SMOTE, modeling, and evaluation. Model testing was conducted using several training–testing split ratios. Model performance was evaluated using confusion matrix. The results indicate that the SVM algorithm achieved the best performance with an accuracy of 89.55% and an F1-Score of 89.58% using an 80:20 data split prior to the application of SMOTE. Overall, SVM demonstrated higher stability and accuracy compared to KNN in classifying adolescent mental health levels, indicating its strong potential as a data-driven early detection tool for adolescent mental health issues. Keywords: Adolescent Mental Health, Stress Level Classification, K-Nearest Neighbor, Support Vector Machine

Copyrights © 2026