knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

beetroot

Travis build status Codecov test coverage Lifecycle: experimental

The goal of beetroot is to enable the parsnip package to fit mixture models.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("hfrick/beetroot")

Example

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") 


hfrick/beetroot documentation built on April 13, 2020, 12:39 a.m.