Hostname: page-component-89b8bd64d-72crv Total loading time: 0 Render date: 2026-05-09T09:09:09.687Z Has data issue: false hasContentIssue false

The role of hyperparameters in machine learning models and how to tune them

Published online by Cambridge University Press:  05 February 2024

Christian Arnold
Affiliation:
Department of Politics and International Relations, Cardiff University, Cardiff, UK
Luka Biedebach
Affiliation:
Department of Computer Science, Reykjavik University, Reykjavik, Iceland
Andreas Küpfer
Affiliation:
Institute for Political Science, Technical University of Darmstadt, Darmstadt, Germany
Marcel Neunhoeffer*
Affiliation:
Rafik B. Hariri Institute for Computing and Computational Science & Engineering, Boston University, Boston, MA, USA Department of Statistics, LMU Munich, Munich, Germany
*
Corresponding author: Marcel Neunhoeffer; Email: marcel@marcel-neunhoeffer.com
Rights & Permissions [Opens in a new window]

Abstract

Hyperparameters critically influence how well machine learning models perform on unseen, out-of-sample data. Systematically comparing the performance of different hyperparameter settings will often go a long way in building confidence about a model's performance. However, analyzing 64 machine learning related manuscripts published in three leading political science journals (APSR, PA, and PSRM) between 2016 and 2021, we find that only 13 publications (20.31 percent) report the hyperparameters and also how they tuned them in either the paper or the appendix. We illustrate the dangers of cursory attention to model and tuning transparency in comparing machine learning models’ capability to predict electoral violence from tweets. The tuning of hyperparameters and their documentation should become a standard component of robustness checks for machine learning models.

Information

Type
Research Note
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
Copyright © The Author(s), 2024. Published by Cambridge University Press on behalf of EPS Academic Ltd
Figure 0

Figure 1. Example with polynomial regression. Data X ~ N(0, 1). Data generating process: $Y = 1 + X + 0.8X^2 + 0.3X^3 + \epsilon$, with $\epsilon \sim N( 0,\; 2)$. Regression Line for Bivariate OLS Model in Blue. Regression Curve for Polynomial Regression with λ = 3 in Teal.

Figure 1

Table 1. Can readers of a publication learn how hyperparameters were tuned and what hyperparameters were ultimately chosen? Hyperparameter explanations in papers published in APSR, PA, and PSRM between 1 January 2016 and 20 October 2021

Figure 2

Table 2. Performance benchmarking of Muchlinski et al. (2021) on different classifiers using our scraped data.

Supplementary material: File

Arnold et al. supplementary material

Arnold et al. supplementary material
Download Arnold et al. supplementary material(File)
File 742.9 KB