Mental health is an important issue in Indonesia, particularly among university students who are vulnerable to anxiety due to academic pressure, life challenges, and emotional instability. This study compares the performance of three machine learning algorithms Decision Tree, Logistic Regression, and Random Forest for detecting anxiety among university students using Python. The results indicate that Logistic Regression achieved the highest accuracy of 90%, while Decision Tree and Random Forest each achieved 80% accuracy. Evaluation using 20% of the dataset for testing and validation with the Taylor Manifest Anxiety Scale (TMAS) showed that Logistic Regression correctly identified 4 out of 5 students with anxiety. These findings demonstrate that Logistic Regression is the most effective algorithm and has strong potential to support early anxiety detection through a data science–based approach.
Copyrights © 2026