A few months ago, the tidymodels team coordinated a community survey to get a sense for what users most wanted to see next in the tidymodels package ecosystem. One resounding theme from responses was that tidymodels users wanted a framework for tidymodels-aligned model stacking.
We’re excited to announce the release of stacks 0.1.0, a package for model stacking that aligns with existing functionality in the tidymodels package ecosystem! Model stacking is an ensembling technique that combines the outputs of many models to generate a new model—referred to as an ensemble in this package—that generates predictions informed by each of its members.
You can install it from CRAN with:
To load the package:
The process of a building a model stack goes something like this:
- Define candidate ensemble members using functionality from rsample, parsnip, workflows, recipes, and tune
- Initialize a
- Iteratively add candidate ensemble members to the
- Evaluate how to combine their predictions with
- Fit candidate ensemble members with non-zero stacking coefficients with
- Predict on new data with
For an example of using stacks to build a stacked ensemble model, see the package vignette.
This release was made possible in part by the RStudio internship program, which allowed me ( Simon Couch) to work on developing stacks full-time throughout July. I’m also grateful for support from Dr. Kelly McConville as well as the Reed College Mathematics Department, where this package will partially fulfill my undergraduate senior thesis requirement.
Also, we thank those who have tested and provided feedback on the developmental versions of the package over the last few months.