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

Rizky Hidayat Hasibuan, Mulkan Azhari

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


Full Text:

PDF

References


Asril, K. Ningsih, R. Fitri, and Muhamadiah, “Edukasi Kesehatan Mental pada Remaja,” Health Community Service, vol. 1, no. 1, pp. 32–36, Dec. 2023, doi: 10.47709/HCS.V1I1.3238.

M. Idris, A. Wijaya, L. Septiani, T. A. Happy, and R. Graharti, “Pemanfaatan Kecerdasan Buatan sebagai Alat Bantu Diagnosis di Bidang Kesehatan : Literatur Review,” Jurnal Kedokteran Universitas Lampung, vol. 9, no. 1, pp. 117–121, Jun. 2025, doi: 10.23960/JKUNILA.V9I1.PP117-121.

V. Oktaviani, N. Rosmawarni, and M. P. Muslim, “Perbandingan Kinerja Random Forest Dan Smote Random Forest Dalam Mendeteksi Dan Mengukur Tingkat Stres Pada Mahasiswa Tingkat Akhir,” Informatik : Jurnal Ilmu Komputer, vol. 20, no. 1, pp. 43–49, Apr. 2024, doi: 10.52958/IFTK.V20I1.9158.

A. R. Aisy, Rahmaddeni, A. H. Siregar, S. Daulay, and N. Ananta, “Implementasi Algoritma Support Vector Machine Dalam Mengklasifikasikan Berita Hoax Di Indonesia Pada Media Sosial X,” Jurnal RESTIKOM : Riset Teknik Informatika dan Komputer, vol. 7, no. 2, pp. 206–216, Aug. 2025, doi: 10.52005/RESTIKOM.V7I2.457.

A. N. Haryanti, M. B. S. Putra, N. Larasati, V. N. Khairunnisa, and L. D. Dewi, “Analisis Kondisi Kesehatan Mental di Indonesia Dan Strategi Penanganannya,” Student Research Journal, vol. 2, no. 3, pp. 28–40, May 2024, doi: 10.55606/SRJYAPPI.V2I3.1221.

A. Yogianto, A. Homaidi, and Z. Fatah, “A Implementation of the K-Nearest Neighbors (KNN) Method for Classification of Heart Disease,” G-Tech: Jurnal Teknologi Terapan, vol. 8, no. 3, pp. 1720–1728, Jul. 2024, doi: 10.33379/GTECH.V8I3.4495.

M. P. Utami, F. Suroso, F. Lailasari, F. P. J. Sibuea, and K. Chandra, “Integrasi Algoritma Support Vector Machine dengan Java untuk Memprediksi Kualitas Komponen Otomotif dalam Industri 4.0,” Techno.Com, vol. 24, no. 3, pp. 790–797, Aug. 2025, doi: 10.62411/TC.V24I3.12719.

S. Junaidi, M. Devegi, and H. Kurniawan, “Pelatihan Pengolahan dan Visualisasi Data Penduduk menggunakan Python,” ADMA : Jurnal Pengabdian dan Pemberdayaan Masyarakat, vol. 4, no. 1, pp. 151–162, Jul. 2023, doi: 10.30812/ADMA.V4I1.2963.

R. G. Guntara, “Pemanfaatan Google Colab Untuk Aplikasi Pendeteksian Masker Wajah Menggunakan Algoritma Deep Learning YOLOv7,” Jurnal Teknologi Dan Sistem Informasi Bisnis, vol. 5, no. 1, pp. 55–60, Feb. 2023, doi: 10.47233/JTEKSIS.V5I1.750.

S. Larasati, E. Dewi, B. H. Farhansyah, F. Abdurrachman Bachtiar, and F. Pradana, “Penerapan Decision Tree dan Random Forest dalam Deteksi Tingkat Stres Manusia Berdasarkan Kondisi Tidur,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 11, no. 5, pp. 1043–1050, Oct. 2024, doi: 10.25126/JTIIK.2024117993.

C. Herdian, A. Kamila, and I. G. A. M. Budidarma, “Studi Kasus Feature Engineering Untuk Data Teks: Perbandingan Label Encoding dan One-Hot Encoding Pada Metode Linear Regresi,” Technologia : Jurnal Ilmiah, vol. 15, no. 1, pp. 93–108, Jan. 2024, doi: 10.31602/TJI.V15I1.13457.

A. Nugroho and E. Rilvani, “Penerapan Metode Oversampling SMOTE Pada Algoritma Random Forest Untuk Prediksi Kebangkrutan Perusahaan,” Techno.Com, vol. 22, no. 1, pp. 207–214, Feb. 2023, doi: 10.33633/TC.V22I1.7527.




DOI: http://dx.doi.org/10.30829/algoritma.v10i1.28151

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Indexing:

Creative Commons License

Algoritma: Jurnal Ilmu Komputer dan Informatika

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.