knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of beetroot is to enable the parsnip package to fit mixture models.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("hfrick/beetroot")
This is a basic example of fitting a mixture model and getting predictions:
library(beetroot) library(rsample) set.seed(403) data("faithful") faithful_split <- initial_split(faithful, prop = 0.95) faithful_train <- training(faithful_split) faithful_test <- testing(faithful_split) mm_spec <- mixture_model(components = 2) %>% set_engine("flexmix") mm_fit <- mm_spec %>% fit(eruptions ~ waiting, data = faithful_train) predict(mm_fit, new_data = faithful_test, type = "numeric")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.