Description Usage Arguments Examples
Bottle a brew
1 |
brew |
an |
type |
a character value indicating what composition the training and testing data should have. Valid options are 'tibble' and 'matrix' |
drop_fit |
a logical value. If |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | x1 = rnorm(100)
x2 = rnorm(100) + x1
x3 = rnorm(100) + x1 + x2
outcome = 0.5 * (x1 - x2 + x3)
n_miss = 10
x1[1:n_miss] <- NA
data <- data.frame(x1=x1, x2=x2, x3=x3, outcome=outcome)
sft_brew <- brew_soft(data, outcome=outcome, bind_miss = FALSE)
sft_brew <- mash(sft_brew, with = masher_soft(bs = TRUE))
sft_brew <- stir(sft_brew, timer = TRUE)
data_new = data.frame(
x1 = c(1/2, NA_real_),
x2 = c(NA_real_, 2/3),
x3 = c(5/2, 2/3),
outcome = c(1/3, 2/3)
)
# soft models are re-fitted after stacking data_new with data_ref
sft_brew <- ferment(sft_brew, data_new = data_new)
bottle(sft_brew, type = 'tibble')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.