Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 Classification Of Student Mental Health Based On Academic And Social Variables Using The Decision Tree Method Desi Anggreani, desianggreani@unismuh. Chyquitha Danuputri. Chyquithadanuputri@unismuh. Muhyiddin A M Hayat, muhyiddin@unismuh. Dedi Setiawan, dedisetiawan@unimen. )Department of Informatics Engineering. Universitas Muhammadiyah Makassar. Indonesia Faculty of Teacher Training and Education. Universitas Muhammadiyah Enrekang. Indonesia Diterima 20 Maret 2025 / Disetujui 20 Juni 2025 ABSTRACT Mental health problems are suffered by many people, including students who often have poor Depression and anxiety are widespread among students, with all universities reporting students with depression and 75. 5% reporting students with severe anxiety. This research aims to determine the classification of student mental health based on academic and social by using the Decision Tree method so that early treatment can be carried out. The dataset used consists of 11 aspects concerning academic and social. The data that has been collected is processed through the preprocessing stage and analyzed using the Decision Tree classification method. The classification results showed that out of 973 students who did not suffer from depression, the method classified them correctly. In addition, of the 104 college students who were classified as suffering from major depression, all of them were actually suffering from major depression. The agreement between the classification results and the actual condition shows the reliability of this method, with an accuracy rate of 76. This research underscores the importance of academic and social variables in influencing students' mental health. The findings confirm the reliability of the Decision Tree method in detecting students' mental state and point to the need for effective counseling services and mental health interventions in campus and social environments. Keywords: Mental Health. Academic. Social. Classification. Decision Tree ABSTRAK Masalah kesehatan mental telah dialamai oleh kebanyakan orang, termasuk mahasiswa yang sering memiliki gaya hidup yang kurang baik. Depresi dan kecemasan tersebar luas di kalangan mahasiswa, dengan semua universitas melaporkan mahasiswa yang mengalami depresi dan 75,5% melaporkan mahasiswa dengan kecemasan berat. Penelitian ini bertujuan untuk menentukan klasifikasi kesehatan mental mahasiswa berdasarkan aspek akademik dan sosial dengan menggunakan metode Decision Tree sehingga dapat dilakukan penanganan dini. Dataset yang digunakan terdiri dari 11 aspek yang berkaitan dengan akademik dan sosial. Data yang telah dikumpulkan diproses melalui tahap prapemrosesan dan dianalisis menggunakan metode klasifikasi Decision Tree. Hasil klasifikasi menunjukkan bahwa dari 973 mahasiswa yang tidak menderita depresi, metode ini mengklasifikasikan mereka dengan benar. Selain itu, dari 104 mahasiswa yang diklasifikasikan menderita depresi berat, semuanya benar-benar menderita depresi berat. Kesepakatan antara hasil klasifikasi dan kondisi aktual menunjukkan keandalan metode ini, dengan tingkat akurasi sebesar 76,71%. Penelitian ini menekankan pentingnya variabel akademik dan sosial dalam mempengaruhi kesehatan mental mahasiswa. Temuan ini mengkonfirmasi keandalan metode Decision Tree dalam mendeteksi kondisi mental mahasiswa dan menunjukkan perlunya layanan konseling yang efektif serta intervensi kesehatan mental di lingkungan kampus dan sosial. Kata Kunci: Kesehatan Mental. Akademik. Sosial. Klasifikasi. Decision Tree *Korespondensi Penulis: E-mail: Chyquithadanuputri@unismuh. Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 INTRODUCTION Mental health is one of the most serious issues that needs to be considered, accounting for 15% of the diseases suffered by the entire world population. The World Health Organization (WHO) reported that in 2019 there were 950 million people living with mental disorders, 52. 4% of women and 47. 6% of men. developing countries such as Indonesia, the 2018 Indonesian Basic Health Research, as many as 9. 8 percent or around 26 million Indonesians over the age of 15 experience emotional and mental disorders. Without a healthy mental state, the person will face difficulties in living their daily lives. With good mental health, a person feels an improved mood, builds resilience, and helps to enjoy life as a whole. There are many poor mental conditions suffered by various groups, including students who have a bad lifestyle. Students lack knowledge and awareness of the importance of mental health, so without realizing the various problems in their minds are the impact of the mental health they feel. Depression and anxiety are widespread among students with all universities reporting students with depression and 75. reporting students with severe anxiety. A study in the UK found that levels of psychological distress increased upon entering university and recent evidence suggests that the prevalence of mental health problems among students, including self-harm and suicide, is increasing. Many mental health in college students can be influenced by various factors including friendship environment, genetics, family, social environment, lifestyle, and others. The classification process of diseases has been implemented by many researchers using different methods. In 2023 research was conducted for the classification of heart disease using the K-Nearest Neighbor method. Based on this research, it is obtained that heart disease patients are more than healthy patients based on the symptoms felt. In the latest research, classification of Electroencephalography (EEG) examinations was carried out to identify diseases such as seizures. Alzheimer's, and schizophrenia. In the study implemented the machine learning method and 4% accuracy. This research will classify the mental health of students by focusing on academic and social students so that this research is expected to provide knowledge of the influence of academic and social variables on student mental health. The student mental health classification process is carried out using the Decision Tree method. This research is expected to be the basis in students maintaining health, detecting early symptoms of mental health disease. By maintaining the mental health of students well, it will increase the resilience of the body and the feeling of calmness in undergoing lectures within the university. RESEARCH METHODS This research uses student mental health data obtained from the official Kaggle The data includes various important information related to the mental health conditions and depression levels of students as well as factors that affect their psychological well-being based on academic and social variables. The data that has been collected amounts to 7023 data which has 11 variables, namely Department. Age. Gender. GPA. Sleep Quality. Physical Activity. Social Environment Support. Marital Status. Extracurricular Activities. Total Semester Credit Load and Student Residence. The target variable in the research data is Student Depression Status which consists of Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 two classifications, namely whether the student suffers from severe depression and does not suffer from depression. Some details of data regarding student mental health can be seen in Table 1. Table 1. Student Mental Health Dataset Age Course Gender Others Engineering Business Computer Science Business Medical Law Business Medical Engineering Law Engineering Computer Science Medical Medical Law Medical Medical Computer Science Relationship Single Married Single In a Relationship Single Married Single Single Married Single In a Relationship In a Relationship In a Relationship In a Relationship In a Relationship Single In a Relationship Married Single Male Female Female Male Male Female Male Female Male Female Female Female Male Male Female Male Female Male Male Extracurricular Involvement Moderate Low High Moderate High Moderate Moderate Moderate Low Moderate Moderate Moderate High Moderate Moderate Moderate Moderate Moderate High IPK Sleep Quality Good Average Good Average Good Good Good Average Poor Average Average Average Average Average Average Good Good Good Good Semester Credit Load Physical Activity Moderate Low Low Low Low Moderate Moderate Low Low Moderate Low Moderate Moderate Moderate Low Low Low Low Moderate Residence Type On-Campus On-Campus On-Campus Off-Campus On-Campus Off-Campus Off-Campus On-Campus On-Campus Off-Campus Off-Campus Off-Campus On-Campus With Family On-Campus Off-Campus Off-Campus With Family Off-Campus Social Support Moderate Low Moderate Moderate High High Moderate Low Moderate Low Moderate Moderate Moderate High Moderate Moderate Moderate High Moderate Depression Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Depresi Berat Tidak Depresi Tidak Depresi Tidak Depresi Depresi Berat Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi Tidak Depresi The data that has been collected will be processed at the preprocessing stage, which is data on classification involving several important steps to ensure the data used in the model has quality and is ready to be analyzed. The following are general steps in the data preprocessing process, namely data cleaning, data transformation, feature extraction and selection, and division of datasets into training data and testing data. After the data has gone through the preprocessing process, the data is ready to enter the classification method stage, namely the Decision Tree. The method applied to create a Decision Tree is the CART (Classification and Regression Tre. CART is a classification method that uses historical data to build a decision tree. Each terminal node in this tree is given a class label or predicted value, thus forming a tree structure called a decision tree where the tree Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 structure is made based on weight entropy. The greater the depth of the tree, the higher the accuracy of the results. The modeling structure of the decision tree method can be seen in Figure 1. Figure 1. Modeling the Decision Tree Method In the decision tree method, the root node will be obtained from the selected attribute based on the calculation of the gain value and entropy value. The highest gain value is the variable that will become the root note. The sequence in performing the calculation is to calculate the entropy value first, after obtaining the entropy value it will be used to calculate the Gain. The equations used in the calculation of the decision tree method are found in equations . Description: S = set of cases n = number of partitions of S pi = proportion of Si to S . Description: S = set of cases A = features n = number of partitions of attribute A |S. = proportion of Si to S |S| = count of cases in S Classification performance measurement is done by comparing the number of all correctly classified test data to the total number of test data. Equation . is a confusion matrix that can be used as a test model to measure classification performance. The use of this equation allows an objective evaluation of how well the Decision Tree model is able to classify student mental health conditions based on existing academic and social variables. True Positive (TP) is the amount of data that is Positive and correctly classified as Positive. False Positive (FP): The Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 amount of data that is Negative but classified as Positive. False Negative (FN): The amount of data that is Positive but classified as Negative. True Negative (TN): The amount of data that is Negative and classified in the system correctly as Negative. The equation can be found in equations . RESULT This research aims to identify and classify the mental health conditions of university students by using academic and social variables as the main factors in the classification process. The student mental health classification process has been implemented using the Decision Tree method. In this research, the data used is divided into two sets, namely training data and testing data. A total of 80% of the overall data is allocated as training data to train the model, while the remaining 20% is used as testing data to evaluate the performance of the model. This data division aims to ensure that the model built has good classification capabilities when applied to data that has never been processed before, so that the results of the classification of student mental health become more accurate Figure 2. Classification Process with Decision Tree Method The results of entropy and gain calculations have been carried out thoroughly to obtain Confidence values for both categories, namely not depressed and severely Through this process, each attribute is analyzed to determine how much it contributes in distinguishing between the two categories. The entropy values help measure the uncertainty or irregularity in the data, while the gain measures the decrease in uncertainty after dividing the data by an attribute. Confidence values for each category are calculated, which represent how confident the model is in performing the classification for each data sample. The classification result is then determined based on the highest Confidence value, where the data sample will be classified into the category that has the highest Confidence value. From the testing data, which includes 20% of the total dataset, the classification results show that there are 1,059 students who do not suffer from depression. This data illustrates that most of the student population in the sample are in a healthy mental state and do not experience depressive disorders. On the other hand, the classification results also showed that there were 345 students who suffered from major depression. This highlights a number of students who need more attention and support in dealing Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 with their mental health conditions. This finding underscores the importance of effective counseling services and mental health interventions on campus to help students with major depression. Tabel 2. Classification of Student Mental Health Classification Results of Depression Decision Tree Method (Depressio. Confidence Confidence (Tidak Depres. (Severe Depressio. Tidak Depresi Tidak Depresi Depresi Berat Tidak Depresi Tidak Depresi Depresi Berat Tidak Depresi Tidak Depresi Depresi Berat Tidak Depresi Depresi Berat Tidak Depresi Tidak Depresi Depresi Berat Depresi Berat Tidak Depresi Tidak Depresi Tidak Depresi Depresi Berat Depresi Berat The results of the decision tree method will be subjected to a series of tests to evaluate the performance of this method in performing classification. The testing process is carried out by comparing the classification result data generated by the decision tree with the actual data on student conditions. This test aims to measure how accurate the decision tree method is in identifying student conditions. The classification result data is compared directly with the actual data to see the level of conformity between prediction and reality. Through this analysis, insight can be gained into the effectiveness of the decision tree method in performing classification. Accuracy = (TP TN)/(TP TN FP FN)*100% Accuracy = . 104 241 . *100% Accuracy = 1077/1404*100% Accuracy = 76,71% DISCUSSION The Impact of Academic Variables on StudentsAo Mental Health Academic variables used in the process of classifying student mental health in this study include several important factors, namely the grade point average (GPA), the number of credits taken, participation in extracurriculars, and the major chosen by the These variables were chosen because they are considered to provide a deeper insight into the relationship between academic achievement and psychological wellbeing. Based on the results of the classification process, it was found that students who experienced severe depression tended to have GPA scores in the range of 3. 1 to 3. 7 and students who did not experience depression in the range of 3. 2 to 4. This finding indicates that students with relatively high GPA achievement but may be under Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 pressure to maintain or improve their grades, are at higher risk of developing major Figure 2 shows the results of the classification process based on GPA Figure 4. Classification of Student Mental Health Based on GPA Score The Impact of Social Variables on Student Mental Health The social aspect of college students' mental health has a very significant In this research classification, various social variables were taken into account to understand how these factors contribute to students' psychological wellbeing. These variables include external social support, such as support received from family, friends, and community, which can provide a sense of security and help reduce stress and anxiety. Students' relationship status is also an important variable to consider, as whether students are In a Relationship or Single can affect their emotional stability and psychological well-being. Students' sleep quality is a major focus in this study, given that adequate and high-quality sleep is essential for maintaining mental and physical health. The last social variable is where students live, whether they live with family, in dormitories, or in boarding houses, is also included as a relevant social variable. This factor can affect the level of comfort and stress that students experience in their daily Social support variables for university students in this study were divided into three main categories based on the level of support they received, namely low, moderate, and high support. Based on the classification results, severe depression is felt in students who get moderate support. Of the 345 students who became test data, 154 students with moderate social support suffered from severe depression. Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 Figure 5. Classification of Student Mental Health Based on Social Support Figure 6. Classification of Students' Mental Health by Relationship Status Based on the 345 data of students who suffered from major depression, it was found that the relationship status AusingleAy had the highest number in terms of prevalence of depression. A total of 178 single students experienced major depression, indicating that this group is the most vulnerable compared to other groups of students. This indicates a significant correlation between relationship status and depression levels, which requires special attention in mental health intervention and support efforts for university students. CONCLUSION AND SUGGESTIONS This research aims to classify students' mental health conditions based on academic and social variables using the Decision Tree method. The results show that the Decision Tree method is able to classify the mental state of college students with a high level of accuracy. From the overall testing data, which covers 20% of the total dataset, it was found that this method identified 1,059 students who did not suffer from Jurnal Algoritma. Logika dan Komputasi Versi Online: https://journal. id/index. php/alu DOI: http://dx. org/10. 30813/j-alu. Vol. Vi (No. 01 ) :762 - 771 Th. p-ISSN: 2620-620X e-ISSN: 2621-9840 depression and 345 students who suffered from severe depression. From the aspect of GPA (Grade Point Averag. value, the analysis shows that students with higher GPA value tend to have a lower risk of suffering from depression. Conversely, students with lower GPA scores are more prone to depression, both mild and severe. This shows that academic achievement has a significant correlation with students' mental health Social variables also play an important role in students' mental health Students who receive high social support from family, friends, and the surrounding environment tend to have better mental health and a lower risk of Conversely, moderate levels to lack of social support can increase the risk of depression in college students. Based on the results of the study on the classification of students' mental health using the Decision Tree method, there are several suggestions that can be considered for further research, namely the use of Other Machine Learning Methods to be able to be a comparison of the results of the current study. In addition, collaborating with Psychology Experts in interpreting the results and preparing more appropriate A multidisciplinary approach will enrich the analysis and implementation of research results BIBLIOGRAPHY