The problem
This coursework project investigates life expectancy using country-level health and socioeconomic indicators across multiple years. The aim was to compare regression models and examine which features the models rely on.
Data and preparation
The workflow inspected distributions, correlations, time trends and regional differences. It used mean imputation for GDP and selected vaccination fields, investigated outliers with the interquartile range and filtered implausible values. Country and region were one-hot encoded rather than given an artificial numerical order.
How features were designed
The analysis averaged two thinness measures to reduce redundancy, combined vaccination coverage into an index and log-transformed population to reduce skew. It also summed infant and under-five deaths. That last construction needs care: the categories may overlap, so the sum should not be interpreted as a count of distinct children.
Approach and model decisions
Linear Regression, Random Forest, SVR, Decision Tree and XGBoost were compared using five-fold shuffled cross-validation. Scaling was placed inside pipelines for scale-sensitive models. RandomizedSearchCV explored larger tuning spaces, using RMSE for selection and MAE, MAPE and R² to describe different aspects of error.
What worked in the evaluation
In our five-fold cross-validation comparison, XGBoost had the lowest error: cross-validation RMSE 0.452 years, compared with 0.509 for Linear Regression and 1.515 for SVR. After tuning, the XGBoost test RMSE was 0.349 years, MAE 0.253 and R² 0.9985. These scores apply to our random-split evaluation; they do not establish performance on unseen countries.
How interpretation changed
The feature-importance analysis removed country and region indicators to focus on health and socioeconomic variables rather than geographic proxies. XGBoost feature importance ranked the constructed child-death feature and adult mortality highly. Model importance describes predictive reliance, not the causal effect of an intervention.
What remains weak
The very high scores require scrutiny. A random split can place different years from the same country in both training and validation, while imputation is shown before splitting. Mortality variables are also closely related to life expectancy. Country proxy effects and feature redundancy mean these scores do not settle generalisation.
Effect and next decisions
The project produced a comparative modelling workflow and an interpretable account of its results. The next evaluation should fit imputation inside each fold, hold out entire countries, test future periods separately and audit whether each predictor would be available at prediction time. There is no measured policy impact or public hosted demo. This was a group coursework project.