Mentalhealthisanimportantpartofemployeewell-beingandorganizationalefficiency,especiallyinthetechnologyindustry where job stress is high. Predictive modeling would be able to recognize persons at risk of pursuing mental health treatment to enable early intervention and resource allocation. In this research, we used machine learning methods on a workplace mental health survey database to predict the respondents\' treatment-seeking behavior. Preprocessing involved dealing with missing values, normalization of categorical responses like gender, outlier correction of ages, and scaling of numerical features. Class imbalance was tackled using the Synthetic Minority Oversampling Technique (SMOTE). Three algorithms were used and compared: Random Forest, K-Nearest Neighbors (KNN), and AdaBoost. The outcome showed that Random Forest had the best accuracy at 83.33%, with slightly lower but comparable performances by KNN and AdaBoost. These results underscore the appropriateness of instance-based and ensemble approaches to mental health prediction tasks and infer that further enhancements such as hyper parameter optimization, sophisticated encoding techniques, and model ensemble can further lead to higher predictive rates above 88%.
Introduction
This research investigates the use of machine learning (ML) to predict whether employees in the technology industry are likely to seek mental health treatment based on workplace survey data.
Mental health problems such as anxiety, depression, and burnout are common concerns in high-pressure technology workplaces. Employees may avoid treatment because of stigma, lack of awareness, or inadequate organizational support. Because treatment-seeking behavior depends on many interacting factors—such as demographics, family history, workplace conditions, benefits, supervisor support, and perceived consequences—traditional statistical approaches may not adequately capture these relationships. ML can identify complex patterns in such multidimensional data.
Methodology
The study followed a machine-learning pipeline consisting of:
Data collection – Workplace mental health survey data containing demographic, family, and organizational information.
Data preprocessing – Missing values were handled, irrelevant variables were removed, age outliers were corrected, gender categories were standardized, categorical variables were encoded, and numerical values were scaled.
Class balancing – SMOTE (Synthetic Minority Oversampling Technique) was used to address the imbalance between employees who had and had not received mental health treatment.
Feature selection – Important factors included gender, self-employment, family history, work interference, benefits, supervisor support, anonymity, and perceived mental-health consequences.
Model development – Three algorithms were compared:
Random Forest
K-Nearest Neighbors (KNN)
AdaBoost
Evaluation – Accuracy, precision, recall, F1-score, and confusion matrices were used.
Deployment – The best-performing Random Forest model was integrated into a Flask web application that provides predictions based on survey responses.
Results
The three models achieved the following reported accuracies:
Model
Accuracy
Random Forest
88.33%
KNN
79.92%
AdaBoost
80.34%
Random Forest performed best, likely because its ensemble of decision trees can capture complex and nonlinear relationships among workplace and demographic factors.
Feature analysis showed that workplace factors were more influential than demographic characteristics. In particular:
Supervisor support
Organizational benefits
Perceived mental-health consequences
were among the strongest predictors of treatment-seeking behavior. Age and gender had comparatively weaker influence.
Literature findings
Previous research supports the use of ML for mental-health prediction using survey data, electronic health records, social media, and physiological signals. Ensemble approaches such as Random Forest and boosting frequently perform well. However, the literature also identifies important limitations, including:
Class imbalance
Small or unrepresentative datasets
Self-reporting and response bias
Cultural and demographic bias
Privacy and consent concerns
Lack of model interpretability
Limited external or longitudinal validation
Conclusion
This research showed the capability of machine learning, in theformofafine-tunedRandomForestClassifier,toforecast whether an individual is likely to undergo treatment for mental health issues based on workplace survey responses. Following thorough preprocessing, feature engineering, and handling class imbalance using SMOTE, the model attained encouragingaccuracyintheclassificationoftreatment-seekingbehavior.Theresultshighlightthat work-related factors family history of mental illness, supervisorsupportperceptions,benefitavailability,andwork interference level are significant predictors of mental health outcomes. Through the identification of these trends, organizations and policymakers can structure preventive measures to minimize stigma, enhance support systems, and promoteearlyintervention.Althoughthemodelworkedwell, limitations including dependence on self-reported survey feedback and analysis using only one dataset need to be considered. Subsequent research needs to utilize more datasets, assess a broader variety of algorithms, and investigate interpretability techniques (e.g., feature importanceandSHAPvalues)togaindeeperinsightintohow the model makes its decisions.
Ultimately, the incorporation of predictive analytics within workplace mental health initiatives can be an excellent resource to support greater well-being, lower absenteeism, and healthier, more supportive workplaces..
References
[1] Dwyer, D. B., et al. (2018). Towards a brain-based predictome ofmental illness. npj Schizophrenia, 4, Article 1.https://doi.org/10.1038/s41537-018-0036-0PMC
[2] Chancellor, S., & De Choudhury, M. (2020). Methods in predictivetechniques for mental health status on social media: A critical review.npj Digital Medicine, 3, Article 43. https://doi.org/10.1038/s41746-020-0233-7Nature
[3] Li, X., et al. (2023). Prediction and diagnosis of depression usingmachine learning with electronic health records. BMC MedicalInformaticsandDecisionMaking,23,Article1. https://doi.org/10.1186/s12911-023-02341-xBioMedCentral
[4] Guntuku, S. C., etal. (2017). What Twitterprofileandpostedimagesrevealabout depressionandanxiety. Proceedings of the InternationalAAAIConferenceonWebandSocialMedia,11,4958.https://ojs.aaai.org/index.php/ICWSM/article/view/14878ScienceDirect
[5] Tran, T., et al. (2023). Real-time mental stress detection usingmultimodality expressions. Frontiers in Psychology, 14, Article9389269. https://doi.org/10.3389/fpsyg.2023.9389269PMC
[6] Coppersmith, G., et al. (2016). Predicting suicide risk from tweets: Anatural language processing approach. Proceedings of the 2016Conference on Empirical Methods in Natural Language Processing,1, 1165–1175. https://aclanthology.org/D16-1134ACL Anthology
[7] Jacobson, N. C., et al. (2020). A comparison of machine learningalgorithms for predicting depression from survey-based datasets.Journal of Affective Disorders, 276, 118–125.https://doi.org/10.1016/j.jad.2020.06.046
[8] Zhang, X., et al. (2022). Deep learning models for stress analysis inuniversitystudents.ScientificReports,12,Article10347184.
[9] https://doi.org/10.1038/s41598-022-25251-6PMC
[10] Orabi, M. A., et al. (2023). Suicide ideation detection from onlinesocial media: A multi-modal approach. Computers in Biology andMedicine, 153, Article 106560.
[11] https://doi.org/10.1016/j.compbiomed.2023.106560ScienceDirect
[12] Kumar,S.,etal.(2020).Machinelearninginmentalhealth:Areview.
[13] npj Digital Medicine, 3, Article 1.https://doi.org/10.1038/s41746-020-0233-7Nature
[14] Shen,L.,etal.(2020).RandomForestforpsychiatricclinicaldatatodetectschizophreniarelapsepredictors.npjSchizophrenia,6,Article https://doi.org/10.1038/s41537-020-00079-1
[15] Cao,X.,etal.(2020).AdaBoostinidentifyingdepressioninteenagersusingresponsestosurveys.ScientificReports,10,Article 1.
[16] https://doi.org/10.1038/s41598-020-70394-2
[17] Ghosh,S.,etal.(2021).Predictingstresslevelsusingsmartphonesensor data. Scientific Reports, 11, Article 1.
[18] https://doi.org/10.1038/s41598-021-88718-1
[19] Yang,X., etal. (2022). XGBoost for predictingsuicidalideation fromhealth survey data. Scientific Reports, 12, Article 1.
[20] https://doi.org/10.1038/s41598-022-25251-6
[21] Harrigian, K., et al. (2020). Predicting employeerisk of burnoutusingworkplace survey data. Journal of Occupational Health Psychology,25, 1–11. https://doi.org/10.1037/ocp0000145
[22] Nadeem,S.,etal.(2020).ContrastingAdaBoostandRandomForestindepressionpredictionfromonlineforumdata.Proceedingsofthe2020Conference on Empirical Methods in Natural Language Processing,1, 1–10. https://aclanthology.org/2020.emnlp-main.1
[23] Rao,Y.,etal.(2021).HybridensembleofRandomForestandK-Nearest Neighbors to forecast stress levels using wearable sensorreadings. Sensors, 21, Article 1. https://doi.org/10.3390/s21010001
[24] Calvo,R.A.,etal.(2020).Asystematicreviewofdigitalmentalhealthprediction through machine learning. npj Digital Medicine, 3, Article
a. https://doi.org/10.1038/s41746-020-0233-7Nature
[25] Alghamdi, A., et al. (2020). K-Nearest Neighbors in forecastinganxiety among students based on survey characteristics. ScientificReports, 10, Article 1. https://doi.org/10.1038/s41598-020-70394-2
[26] Wang, L., et al. (2020). AdaBoost inworkplace mentalhealth surveystopredicttreatment-seekingbehavior.JournalofOccupationalHealthPsychology, 25, 1–11. https://doi.org/10.1037/ocp0000145