

stacks
An R package for tidy stacked ensemble modeling
stacks is an R package for model stacking that integrates with the tidymodels ecosystem. It creates ensemble models by combining predictions from multiple trained models (called members) into a single meta-model that leverages the strengths of each individual model.
The package uses regularized linear regression to determine stacking coefficients, automatically selecting which candidate models contribute to the final ensemble by zeroing out low-performing members. It works with any model type from parsnip, any resampling scheme from rsample, and any error metric from yardstick, making it flexible across different modeling scenarios. The workflow involves adding candidate models to a data stack, blending their predictions through metalearning, and fitting the final ensemble on the full training set.





