Replication Data and Code for “Demographic Pressure, Labour Structure and Unemployment in Africa and Europe: A Comparative Machine Learning Study”

Published: 11 June 2026| Version 1 | DOI: 10.17632/dwsn6d48mv.1
Contributors:
,

Description

This dataset supports the study titled “Demographic Pressure, Labour Structure and Unemployment in Africa and Europe: A Comparative Machine Learning Study.” The study examines how demographic pressure, labour structure, macroeconomic performance, education, and urbanization predict unemployment across African and European economies. The repository contains the processed analytical dataset and Python code used for the empirical analysis. The data cover Africa and Europe from 1985 to 2024, producing 4,120 country-year observations. The target variable is total unemployment as a percentage of the total labour force, based on the modelled International Labour Organization estimate. The modelling predictors include age dependency ratio, old-age dependency ratio, young-age dependency ratio, population ages 0 to 14, population ages 15 to 64, population ages 65 and above, employment in agriculture, employment in industry, employment in services, GDP growth, tertiary school enrolment, and urban population share. Continent, subregion, income level, and lending type are retained as categorical features in the modelling workflow. The accompanying Python notebook reproduces the full analysis. It loads the topic-specific Excel dataset, generates descriptive statistics, checks missingness, produces a correlation heatmap, and plots unemployment trends by continent or subregion. It then estimates Random Forest, Extra Trees, and Gradient Boosting regression models. Model performance is assessed using mean absolute error, root mean squared error, and R-squared. The notebook also generates permutation feature importance, prediction diagnostics, principal component analysis, MiniBatch K-means clustering, two-dimensional PCA cluster maps, three-dimensional PCA visualization, and cluster profile tables. The files are shared to support transparency, replication, and further research on unemployment, demographic pressure, labour-market structure, education, urbanization, and machine learning applications in comparative development research.

Files

Steps to reproduce

Download all repository files into one working folder. Open the Python notebook named Topic_07_Demographic_Labour_Vulnerability.ipynb in Jupyter Notebook, JupyterLab, VS Code, or Google Colab. Place the Excel file named Topic_07_data.xlsx in the same folder as the notebook. If the Excel file has a different name, update the DATA_FILE line in the notebook. Install the required Python packages before running the notebook: pandas, numpy, matplotlib, scikit-learn, openpyxl. Run the notebook cells from top to bottom without skipping any cell. The notebook first loads the processed Africa and Europe country-year panel from the Data sheet. It prepares the target variable, total unemployment as a percentage of the total labour force. It prepares the demographic, labour-market, macroeconomic, education, and urbanization predictors. It includes continent, subregion, income level, and lending type as categorical modelling features. It generates descriptive statistics, missingness summaries, a correlation heatmap, and unemployment trend plots. It estimates Random Forest, Extra Trees, and Gradient Boosting regression models. It evaluates model performance using mean absolute error, root mean squared error, and R-squared. It generates interpretation outputs, including permutation feature importance and prediction diagnostics. It performs principal component analysis and MiniBatch K-means clustering. Tables, figures, cluster outputs, and model results are saved in the outputs folder created by the notebook.

Institutions

Categories

Unemployment, Machine Learning

Licence