Exploring commuter stress dynamics through machine learning and double optimization
DOI:
https://doi.org/10.22581/muet1982.0062Keywords:
Double optimization, Imbalanced dataset, Machine learning, stress, SHAP, Road safetyAbstract
Travel dynamics significantly impact commuter stress, influenced by traffic behavior, road conditions, travel modes, distance, and socio-demographic characteristics. Previous research on travel stress often exhibits limitations, including narrow scopes focusing on specific routes, vehicle types, or demographics. This study addresses these constraints by employing a comprehensive approach to analyze the influence of various travel attributes on commuter stress levels. An interview-based dataset was collected to capture the multifaceted experiences of road users. Five tree-based machine learning models–Decision Tree (DT), Random Forests (RF), Extra Trees (ET), Extreme Gradient Boosting (XGBoost), and k-Nearest Neighbor (k-NN)–were deployed for imbalanced multi-class classification. XGBoost demonstrated superior performance with the highest accuracy (73.33%) and precision (75.63%) with a standard deviation of ±5.9. A novel double hyperparameter optimization technique enhanced the prediction accuracy across all models, notably increasing the k-NN classifier’s accuracy to 19.99%. The SHAP (SHapley Additive exPlanations) method was utilized for model interpretability, revealing distance traveled per day as the most influential factor across stress levels, followed by mode of transport, gender, and age for low, medium, and high-stress categories, respectively. The study also examines the impact of features on individual commuter stress levels through random instance selection. This research provides valuable insights into the complex interplay between travel attributes and commuter stress, paving the way for the development of effective stress mitigation strategies and improved travel experiences for all road users.
Downloads
References
Britannica, “Karachi, Pakistan”, Accessed: Dec. 03, 2024. Available at: https://www.britannica.com/place/Karachi.
Worldometer, “Largest cities in the world”, Accessed: Dec. 03, 2024. Available at: https://www.worldometers.info/population/largest-cities-in-the-world/.
M. Welde and E. Tveter, “The wider local impacts of new roads: A case study of 10 projects”, Transport Policy, vol. 115, pp. 164–180, 2022, doi: 10.1016/j.tranpol.2021.11.012.
R. Mushtaq and O. Hashmi, “Traffic congestion and prevalence of mental and physical health issues in Karachi, Pakistan”, Journal of Psychology, vol. 53, no. 02, pp. 15–24, 2022.
V. C. Magaña, M. M. Organero, J. A. Fisteus, and L. S. Fernández, “Estimating the stress for drivers and passengers using deep learning”, Proceedings of “JARCA 2016”, Almería, Spain, 2016, pp. 1–6.
M. A. Conceição, M. M. Monteiro, D. Kasraian, P. van den Berg, S. Haustein, I. Alves, C. L. Azevedo, and B. Miranda, “The effect of transport infrastructure, congestion, and reliability on mental wellbeing: a systematic review of empirical studies”, Transport Reviews, vol. 43, no. 2, pp. 264–302, 2023, doi: 10.1080/01441647.2022.2100943.
A. Ahmed and B. Aijaz, “A Case Study on the Potential Applications of V2V Communication for Improving Road Safety in Pakistan”, Engineering Proceedings, vol. 32, no. 1, p. 17, Karachi, Pakistan, 2023, doi: 10.3390/engproc2023032017.
S. Mirza, M. Pervaiz, and N. Khatoon, “Stress-inducing factors among occupational drivers in Karachi, Pakistan”, Eastern Mediterranean Health Journal, vol. 26, no. 10, pp. 1233–1241, 2020, doi: 10.26719/emhj.20.059.
S. Zhong, X. Fu, W. Lu, F. Tang, and Y. Lu, “An expressway driving stress prediction model based on vehicle, road, and environment features”, IEEE Access, vol. 10, pp. 57212–57226, 2022, doi: 10.1109/ACCESS.2022.3165570.
G. Gottholmseder, K. Nowotny, G. J. Pruckner, and E. Theurl, “Stress perception and commuting”, Health Economics, vol. 18, no. 5, pp. 559–576, 2009, doi: 10.1002/hec.1389.
A. Legrain, N. Eluru, and A. M. El-Geneidy, “Am stressed, must travel: The relationship between mode choice and commuting stress”, Transportation Research Part F: Traffic Psychology and Behaviour, vol. 34, pp. 141–151, 2015, doi: 10.1016/j.trf.2015.08.001.
S. M. A. Jahangeer, N. Hasnain, M. T. Tariq, A. Jamil, S. Y. Zia, and W. Amir, “Frequency and association of stress levels with modes of commuting among medical students of a developing country”, Malaysian Journal of Medical Sciences, vol. 28, pp. 113–122, 2021, doi: 10.21315/mjms2021.28.4.12.
D. Ettema, M. Friman, T. Garling, and L. E. Olsson, “Travel mode use, travel mode shift, and subjective well-being: Overview of theories, empirical findings and policy implications”, Mobility, Sociability and Wellbeing of Urban Living, D. Wang and S. He, Eds. Berlin, Heidelberg: Springer, 2016, pp. 129–150. ISBN: 978-3-662-48184-4.
V. Singh, K. Gupta, A. Agarwal, and N. Chakrabarty, “Psychological impacts on the travel behaviour post COVID-19”, Asian Transport Studies, vol. 8, p. 100087, 2022, doi: 10.1016/j.eastsj.2022.100087.
M. C. I. van Schalkwyk and J. S. Mindell, “Current issues in the impacts of transport on health”, British Medical Bulletin, vol. 125, no. 1, pp. 67–77, 2018, doi: 10.1093/bmb/ldx048.
L. Montoro, S. Useche, F. Alonso, and B. Cendales, “Work environment, stress, and driving anger: A structural equation model for predicting traffic sanctions of public transport drivers”, International Journal of Environmental Research and Public Health, vol. 15, no. 3, p. 497, 2018, doi: 10.3390/ijerph15030497.
N. A. Mohammad, “Stress and anxiety on the road: The silent victims and their sufferings”, Journal of Advanced Vehicle System, vol. 13, no. 1, pp. 57–69, 2022.
W. Wei, X. Fu, S. Zhong, and H. Ge, “Driver's mental workload classification using physiological, traffic flow, and environmental factors”, Transportation Research Part F: Traffic Psychology and Behaviour, vol. 94, pp. 151–169, 2023, doi: 10.1016/j.trf.2023.02.004.
M. Kavitha, M. Pingili, M. Spurthi, S. K. Fayaz, K. Kirthan, and S. Santhosh, “Classification algorithms based mental health prediction using data mining”, Turkish Journal of Computer and Mathematics Education, vol. 13, no. 2, pp. 1168–1175, 2020, doi: 10.17762/turcomat.v13i2.13708.
V. Dham, K. Rai, and U. Soni, “Mental stress detection using artificial intelligence models”, Journal of Physics: Conference Series, vol. 1950, p. 012047, 2021, doi: 10.1088/1742-6596/1950/1/012047.
C. Ding, Y. Zhang, and T. Ding, “A systematic hybrid machine learning approach for stress prediction”, PeerJ Computer Science, vol. 9, p. e1154, 2023, doi: 10.7717/peerj-cs.1154.
Y. Meng, N. Yang, Z. Qian, and G. Zhang, “What makes an online review more helpful: An interpretation framework using XGBoost and SHAP values”, Journal of Theoretical and Applied Electronic Commerce Research, vol. 16, no. 3, pp. 466–490, 2020, doi: 10.3390/jtaer16030029.
Y. Xue, “An overview of overfitting and its solutions”, Journal of Physics: Conference Series, vol. 1168, no. 2, p. 022022, 2019, doi: 10.1088/1742-6596/1168/2/022022.
M. U. Abdulazeez, W. Khan, and K. A. Abdullah, “Predicting child occupant crash injury severity in the United Arab Emirates using machine learning models for the imbalanced dataset”, IATSS Research, vol. 47, no. 2, pp. 134–159, 2023, doi: 10.1016/j.iatssr.2023.05.003.
S. Devlin, C. Singh, W. J. Murdoch, and B. Yu, “Disentangled attribution curves for interpreting random forests and boosted trees”, Machine Learning, 2019, doi: 10.48550/arXiv.1905.07631.
S. M. Lundberg and S.-I. Lee, “A unified approach to interpreting model predictions”, Advances in Neural Information Processing Systems, vol. 30, 2017.
M. T. Kashifi, “Investigating two-wheeler risk factors for severe crashes using an interpretable machine learning approach and SHAP analysis”, IATSS Research, vol. 47, no. 3, pp. 357–371, 2023, doi: 10.1016/j.iatssr.2023.07.005.
S. M. Lundberg, G. G. Erion, and S.-I. Lee, “Consistent individualized feature attribution for tree ensembles”, ArXiv, vol. abs/1802.03888, 2018.
G. M. Sullivan and A. R. Artino Jr., “Analyzing and interpreting data from Likert-type scales”, Journal of Graduate Medical Education, vol. 5, pp. 541–542, 2013, doi: 10.4300/JGME-5-4-18.
T. Shimazaki and M. Rahman, “Physical characteristics of paratransit in developing countries of Asia”, Journal of Advanced Transportation, vol. 30, no. 2, pp. 5–24, 1996, doi: 10.1002/atr.5670300203.
M. McCaffery and A. Beebe, Pain: Clinical Manual for Nursing Practice. Mosby, 1989.
S. M. Saqib, T. Mazhar, M. Iqbal, T. Shahazad, A. Almogren, A. U. Rehman, et al., “Enhancing electricity theft detection with ADASYN-enhanced machine learning models”, Electrical Engineering, 2025/03/23 2025. doi: 10.1007/s00202-025-03044-4.
E. Bartz, T. Bartz-Beielstein, M. Zaefferer, and O. Mersmann, Hyperparameter Tuning for Machine and Deep Learning with R., 2023.
L. Breiman, “Random forests”, Machine Learning, vol. 45, no. 1, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.
P. Geurts, D. Ernst, and L. Wehenkel, “Extremely randomized trees”, Machine Learning, vol. 63, pp. 3–42, 2006, doi: 10.1007/s10994-006-6226-1.
T. Chen and C. Guestrin, “XGBoost: A scalable tree boosting system”, Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 785–794, USA, 2016, ISBN 9781450342322.
D. W. Aha, D. Kibler, and M. K. Albert, “Instance-based learning algorithm”, Machine Learning, vol. 6, pp. 37–66, 1991, doi: 10.1007/BF00153759.
L. S. Shapley, “A value for n-person games”, Contributions to the Theory of Games II, H. W. Kuhn and A. Tucker, Eds. Princeton: Princeton University Press, 1953, pp. 69–79.
L. Li, X. Pan, H. Yang, T. Zhang, and Z. Liu, “Supervised dictionary learning with regularization for near-infrared spectroscopy classification”, IEEE Access, vol. 7, pp. 100923–100932, 2019, doi: 10.1109/ACCESS.2019.2930288.
K. Chatterjee, S. Chng, B. Clark, A. Davis, J. De Vos, D. Ettema, S. Handy, A. Martin, and L. Reardon, “Commuting and wellbeing: a critical overview of the literature with implications for policy and future research”, Transport Reviews, vol. 40, no. 1, pp. 5–34, 2020, doi: 10.1080/01441647.2019.1649317.
F. Rahman, Md. A. Islam, and Md. Hadiuzzaman, “Paratransit service quality modeling reflecting users' perception: A case study in Dhaka, Bangladesh”, IATSS Research, vol. 47, no. 3, pp. 335–348, 2023, doi: 10.1016/j.iatssr.2023.07.001.
M. Harikha, J. C. Kimmel, M. Abdelsalam, and M. Gupta, “Analyzing and explaining black-box models for online malware detection”, IEEE Access, vol. 11, pp. 25237–25252, 2023, doi: 10.1109/ACCESS.2023.3255176.
Published
Issue
Section
License
Copyright (c) 2025 Mehran University Research Journal of Engineering and Technology

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
How to Cite
Similar Articles
- Maria Ashraf, Maryam Arshad, Sajjad Haider Zaidi, Kiran Shaukat , Balancing comfort and conservation: dynamic programming algorithm for appliance scheduling in residential demand-side management , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 3 (2025): July Issue
- Saquaib Almani, Zaheer Ahmed Almani, Muhammad Rehan Hakro, Faizan Ali Abro, Stability Analysis of Landslide-Prone Slopes Adjacent to MUET Buildings and their Remediation , Mehran University Research Journal of Engineering and Technology: Vol. 45 No. 3 (2026): July Issue
- Amir Rizvi , Ahmad Hussain , Abdul Rehman Abbasi , Development of a Novel Reliability-Centered Framework and Maintenance Strategies for the Asset Management and Sustainability of Rotary Equipment , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 4 (2025): October Issue
- Saima Bhatti, Fozia Shaikh, Asif Mansoor, Asif Ali Shaikh , A unique statistical framework to predict the health of a machine by utilizing the vibration features of rolling element bearing data , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 3 (2025): July Issue
- Bilal Khan, Mahad Aurangzeb , Mohammad Dawood Farukh, Abdul Muqsit, Komail Lodhi, Mechanism Design and Evaluation of a Threaded Rod-Driven Wheelchair-to-Bed Transformation System , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 4 (2025): October Issue
- Tehmina Karamat, Mohsan Tanveer, Taimur Karamat, Muhammad Suleman, Performance optimization of multimedia services in wireless multimedia sensor networks (WMSN) at the socket level , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 4 (2025): October Issue
- Safa Sattar, Johar Khurshid Farooqi , Bilal Zahid , Alkali Treatment Effects on the Tensile Characteristics of Vacuum-Infused Banana and Flax Woven Fiber Composites , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 4 (2025): October Issue
- Hafiz Muhammad Saud, Tahir Sultan, Abdul Waqar Rajput, Ammad Hassan Khan, Muhammad Sabeeh Ul Zaman, Recycled Hybrid Fiber Reinforced Concrete Modified with Nano Zirconia: Mechanical Performance and Pavement Application , Mehran University Research Journal of Engineering and Technology: Vol. 45 No. 2 (2026): April Issue
- Sanam Irum Memon , Abdul Wahab Memon , Umaima Saleem Memon , Nadir Ali , Assessment of the impact of different weave geometries on the crimp factor of woven preforms made from high-performance carbon filaments , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 2 (2025): April Issue
- Muhammad Rehan Saleem, Amjad Hussain Zahid, Ghulam Mustafa, Dynamic S-box construction based on a novel chaotic map and twitching approach , Mehran University Research Journal of Engineering and Technology: Vol. 44 No. 4 (2025): October Issue
You may also start an advanced similarity search for this article.