Happiness has emerged as a key indicator of sustainable development and societal well-being, complementing traditional economic measures such as Gross Domestic Product (GDP). Understanding the determinants of happiness is particularly important for developing countries, where economic growth, social inequalities, healthcare, and education significantly influence citizens’ quality of life. Despite the increasing application of Artificial Intelligence in social sciences, the use of Machine Learning (ML) to analyze and predict happiness in Morocco remains largely unexplored. This study proposes an explainable Machine Learning framework to predict the Happiness Index in Morocco and identify the socioeconomic, demographic, and health-related factors that most strongly influence individual well-being. In this paper, we will propose a framework that provides an interpretable and data-driven decision-support tool for policymakers, enabling evidence-based strategies to improve citizens’ quality of life. By combining advanced Machine Learning algorithms with Explainable AI, this research contributes to the growing literature on computational social science and represents one of the first comprehensive ML-based analyses of happiness prediction in the Moroccan context. The proposed approach can be extended to other developing countries to support sustainable development policies and well-being assessment.
Cite this paper
Chehayebat, A. , Marah, R. and Marah, R. (2026). A Data-Driven Explainable Machine Learning Framework for Happiness Prediction in Morocco. Open Access Library Journal, 13, e15876. doi: http://dx.doi.org/10.4236/oalib.1115876.
Clark, A.E., Flèche, S., Layard, R., Powdthavee, N. and Ward, G. (2018) The Origins of Happiness: The Science of Well-Being over the Life Course. Princeton University Press. <br>https://doi.org/10.2307/j.ctvc77dgq
Khan, A.E., Hasan, M.J., Anjum, H., Mohammed, N. and Momen, S. (2024) Predicting Life Satisfaction Using Machine Learning and Explainable AI. <i>Heliyon</i>, 10, e31158. <br>https://doi.org/10.1016/j.heliyon.2024.e31158
Dolan, P., Peasgood, T. and White, M. (2008) A Review of the Economic Literature on the Factors Associated with Subjective Well-Being. <i>Journal of Economic Psychology</i>, 29, 94-122.
Kahneman, D. and Deaton, A. (2010) High Income Improves Evaluation of Life but Not Emotional Well-Being. <i>Proceedings of the </i><i>National</i><i> Academy of Sciences</i>, 107, 16489-16493. <br>https://doi.org/10.1073/pnas.1011492107
Easterlin, R.A. (1974) Does Economic Growth Improve the Human Lot? Some Empirical Evidence. In: David, P.A. and Reder, M.W., Eds., <i>Nations and Households in Economic Growth</i>:<i> Essays in Honor of Moses Abramovitz</i>, Elsevier, 89-125. <br>https://doi.org/10.1016/b978-0-12-205050-3.50008-7
Clark, A.E., Frijters, P. and Shields, M.A. (2008) Relative Income, Happiness, and Utility: An Explanation for the Easterlin Paradox and Other Puzzles. <i>Journal of Economic Literature</i>, 46, 95-144. <br>https://doi.org/10.1257/jel.46.1.95
Deaton, A. (2008) Income, Health, and Well-Being around the World: Evidence from the Gallup World Poll. <i>Journal of Economic Perspectives</i>, 22, 53-72. <br>https://doi.org/10.1257/jep.22.2.53
Oparina, E., Kaiser, C., Gentile, N., Tkatchenko, A., Clark, A.E., De Neve, J., <i>et al</i>. (2025) Machine Learning in the Prediction of Human Wellbeing. <i>Scientific Reports</i>, 15, Article No. 1632. <br>https://doi.org/10.1038/s41598-024-84137-1
Haut-Commissariat au Plan (2012) Enquête Nationale sur le Bien-être: Principaux résultats [Rapport de recherche]. Royaume du Maroc. <br>https://www.hcp.ma/Intervention-de-M-le-Haut-Commissaire-au-Plan-Presentation-des-resultats-de-l-enquete-nationale-sur-le-bien-etre_a1074.html
Ipsos (2015) Enquête nationale sur le bonheur des Marocains—Présentation des résultats [Présentation]. Commanditée par Atlanta Assurances. <br>https://www.therollingnotes.com/2015/03/27/document-synthese-globale-des-resultats-de-lenquete-sur-le-bonheur-des-marocains/
Song, J., Pan, F. and Liu, H. (2025) Income, Psychological Security, and Subjective Well-Being in Urban China: A Machine Learning Analysis with SHAP Interpretation. <i>BMC Psychology</i>, 13, Article No. 1007. <br>https://doi.org/10.1186/s40359-025-03591-2
Diener, E., Oishi, S. and Lucas, R.E. (2015) National Accounts of Subjective Well-being. <i>American Psychologist</i>, 70, 234-242. <br>https://doi.org/10.1037/a0038899
Han, N., Wen, Y., Wang, B., Huang, F., Liu, X., Li, L., <i>et al</i>. (2024) Developing a Machine Learning-Based Instrument for Subjective Well-Being Assessment on Weibo and Its Psychological Significance: An Evaluative and Interpretive Research. <i>Applied Psychology</i>:<i> Health and Well</i>-<i>Being</i>, 16, 2246-2265. <br>https://doi.org/10.1111/aphw.12590
Prokhorenkova, L., Gusev, G., Vorobev, A., Dorogush, A.V. and Gulin, A. (2018) CatBoost: Unbiased Boosting with Categorical Features. 32<i>nd Conference on Neural Information Processing Systems</i> (<i>NeurIPS</i> 2018), Montréal, 3-8 December 2018. <br>https://proceedings.neurips.cc/paper_files/paper/2018/file/14491b756b3a51daac41c24863285549-Paper.pdf
Chen, T. and Guestrin, C. (2016) XGBoost: A Scalable Tree Boosting System. In: <i>Proceedings of the </i>22<i>nd ACM SIGKDD International Conference on Knowledge Dis</i><i>covery and Data Mining</i>, Association for Computing Machinery, 785-794. <br>https://doi.org/10.1145/2939672.2939785