Super learning is an ensemble machine learning approach used increasingly as an alternative to classical prediction techniques. When implementing super learning, however, not tuning the hyperparameters of the algorithms in it may adversely affect the performance of the super learner.
In this case study, we used data from a Canadian electronic prescribing system to predict when primary care physicians prescribed antidepressants for indications other than depression. The analysis included 73,576 antidepressant prescriptions and 373 candidate predictors. We derived two super learners: one using tuned hyperparameter values for each machine learning algorithm identified through an iterative grid search procedure and the other using the default values. We compared the performance of the tuned super learner to that of the super learner using default values (“untuned”) and a carefully constructed logistic regression model from a previous analysis.
The tuned super learner had a scaled Brier score (R2) of 0.322 (95% CI 0.267-0.362). In comparison, the untuned super learner had a scaled Brier score of 0.309 (95% CI 0.256-0.353), corresponding to an efficiency loss of 4% (relative efficiency 0.96; 95% CI 0.93-0.99). The previously-derived logistic regression model had a scaled Brier score of 0.307 (95% CI 0.245-0.360), corresponding to an efficiency loss of 5% relative to the tuned super learner (relative efficiency 0.95; 95% CI 0.88-1.01).
In this case study, hyperparameter tuning produced a super learner that performed slightly better than an untuned super learner. Tuning the hyperparameters of individual algorithms in a super learner may help optimize performance.
This is an open-access article distributed under the terms of the Creative Commons Attribution-Non Commercial-No Derivatives License 4.0 (CCBY-NC-ND), where it is permissible to download and share the work provided it is properly cited. The work cannot be changed in any way or used commercially without permission from the journal.
1Department of Epidemiology, Biostatistics, and Occupational Health, McGill University, Montreal, Canada
2School of Computer Science, McGill University, Montreal, Canada
Conflicts of interest: None declared
Sources of funding: This work was supported by the Vanier Canada Graduate Scholarship from the Canadian Institutes of Health Research; the Max E. Binz Fellowship from the Faculty of Medicine, McGill University; a graduate student fellowship from the Research Institute of the McGill University Health Centre; and grant IOP-112675 from the Canadian Institutes of Health Research.
Process for obtaining data and computing code: Study data are not available as they contain confidential patient information. A sample of our R code is included in the eAppendix 3, but readers can request additional code from the corresponding author.
Corresponding author: Jenna Wong, Department of Population Medicine, Harvard Medical School and Harvard Pilgrim Health Care Institute, 401 Park Drive, Suite 401 East, Boston, MA 02215, Email: email@example.com, Telephone: 617-867-4513