Komparasi Algoritma KNN Dan SVM Untuk Klasifikasi Kesehatan Mental Pada Usia Remaja
DOI:
https://doi.org/10.30829/algoritma.v10i1.28151Abstract
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 MachineReferences
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.
Downloads
Additional Files
Published
Issue
Section
License
Copyright
Authors published in this journal agree to the following terms:
The copyright of each article remains with the author
The authors grant the journal first publication rights with the work simultaneously licensed under the Creative Commons Attribution License, which allows others to share the work with acknowledgment of authorship and initial publication in this journal.
Authors may enter into separate additional contractual agreements for non-exclusive distribution of the journal's published version of the work (e.g., submitting it to an institutional repository or publishing it in a book), with acknowledgment of their initial publication in this journal.
Authors are permitted and encouraged to post their work online (E.g. in an Institutional Repository or on their website) before and during the submission process, as this can lead to productive exchange, as well as citing earlier and larger published works.
The article and all related materials are published under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
This is a summary that the reader's license allows (and is not a replacement). Disclaimer.
You are free to:
Share — copying and redistributing material in any medium or format
Adapt — remix, change, and build on the material for any purpose, even commercial.
The licensor cannot take away this freedom as long as you follow the terms of the license.
Under the following conditions:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, modify, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything under the license.