blrf <- function(formula, data, newdata, s, gamma, r, workers = 1){
n <- nrow(data)
b = ceiling(n^gamma)
plan(multiprocess, workers = workers)
future_map(seq_len(s),
~{
index <- sample(n, b, replace = FALSE)
map_dbl(seq_len(r),
~{
freqs <- rmultinom(1, n, rep(1, b))
t <- tree(formula, data[index,], weights = freqs)
predict(t, newdata)
}
) %>%
mean()??
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.