Machine Learning in Epidemiology

Marvin N. Wright, Lukas Burk, Pegah Golchian, Jan Kapar, Niklas Koenen, S. LangbeinOpenalex Unknown 2024 · DOI · arXiv · OpenAlex

Abstract

As epidemiology transitions into the era of big data, traditional statistical models often struggle to capture the complex, non-linear interactions inherent in high-dimensional health datasets. This paper presents a comprehensive methodological framework for integrating machine learning (ML) into epidemiological research. By focusing on tree-based ensembles, rigorous resampling techniques, and post-hoc interpretability methods, we demonstrate how ML can move beyond "black box" predictions to provide actionable scientific insights. Using the UCI Heart Disease dataset as a case study, we highlight the importance of hyperparameter optimization and pruning in developing robust, generalizable models.

Introduction

Epidemiology is increasingly inundated with complex data from electronic health records, genomics, and wearable technology. While traditional tools like logistic regression remain vital for inference, they often require manual specification of interactions, which can introduce bias. Machine learning offers a data-driven alternative, capable of automatically learning intricate patterns. However, the adoption of ML in public health is frequently hindered by concerns regarding overfitting and a lack of transparency. This paper aims to bridge this gap, providing a roadmap for epidemiologists to utilize these advanced algorithmic tools with scientific rigor.

Methods and Materials

The study utilizes the Heart Disease Dataset (Janosi et al., 1988), which includes 270 patients and 13 clinical features such as age, chest pain type, and blood pressure. The objective is binary classification: predicting the presence or absence of heart disease.

Supervised Learning and Tree-Based Methods

The framework prioritizes tree-based methods, such as Random Forests and XGBoost, over deep learning for tabular clinical data. Tree-based models are often more effective for structured datasets and are easier to interpret and tune.

Decision tree and corresponding partition plot showing how the model divides the feature space for ST_depression and serum_cholesterol.

Model Evaluation and Generalization

To prevent overfitting—where a model memorizes noise rather than signal—the paper advocates for k-fold cross-validation and nested resampling. Nested resampling is particularly essential for obtaining unbiased performance estimates when hyperparameters are tuned via methods like Bayesian Optimization or Random Search.

A critical step in ensuring model generalization is cost-complexity pruning. This process involves simplifying the model to find the optimal balance between training accuracy and test-set performance.

Prediction error as a function of the complexity parameter (cp), illustrating the point where pruning minimizes error on unseen data.

Results and Key Insights

The application of this workflow to the heart disease dataset yielded several significant results:

  • Optimization Gains: A baseline XGBoost model achieved 79% accuracy, which improved to 82.5% following hyperparameter tuning via Random Search.
  • Interpretability in Practice: Using post-hoc methods like Shapley values, we identified that for specific patients, the "number of major vessels" was the most influential predictor of risk.
  • Feature Effects: The study advocates for Accumulated Local Effects (ALE) plots over Partial Dependence Plots (PDPs) when features are correlated, as ALE plots provide more robust estimates of global feature effects.

Discussion

While ML provides superior predictive power, it is not a direct replacement for causal inference. The authors emphasize that standard ML excels at prediction, but determining causal relationships (e.g., the effect of a specific drug) requires specialized techniques like Causal Machine Learning. Additionally, the paper addresses the "Fairness Frontier," noting that ML models can amplify biases in training data, making data quality more critical than sheer volume. Finally, generative models like Variational Autoencoders (VAEs) are introduced as a means to create privacy-preserving synthetic datasets, facilitating safer data sharing in medical research.

Conclusion

Machine learning represents a transformative tool for epidemiology. By moving from simple prediction to rigorous interpretation, researchers can leverage high-dimensional data to improve public health outcomes while maintaining the transparency required for clinical and regulatory environments.

Summary updated

BibTeX
@inproceedings{wright2024machine,
  author = {Marvin N. Wright and Lukas Burk and Pegah Golchian and Jan Kapar and Niklas Koenen and S. Langbein},
  title = {{Machine Learning in Epidemiology}},
  booktitle = {Openalex Unknown},
  year = {2024},
  doi = {10.1007/978-1-4614-6625-3\_81-1},
}

Loading related content...

Figure