View source: R/fit_min_ave_tree.R
fit_min_ave_tree_algorithm | R Documentation |
Fit minimum average tree
fit_min_ave_tree_algorithm(at, a, w, y, fold, parallel_cv, min_max, min_obs)
at |
Training dataframe |
a |
Variable names in the mixture |
w |
Variable names in the covariates |
y |
Variable name for the outcome |
fold |
Current fold in the cross-validation |
parallel_cv |
TRUE/FALSE indicator to parallelize cv |
min_max |
Min or Max oracle region to go for |
min_obs |
Minimum number of observations needed to make a split |
Fits the min ave tree
A list of the mixture rule results within a fold including:
rules
: A data frame with the data adpatively
determined rules found in the pre
model along with the coefficient,
direction, fold, RMSE and other measures.
model
: The best fitting pre model found in the fold.
data <- simulate_mixture_cube()
mix_comps <- c("M1", "M2", "M3")
W <- c("age", "sex", "bmi")
sls <- create_sls()
w_stack <- sls$W_stack
tree_stack <- sls$A_stack
example_output <- fit_pre_algorithm(
at = data,
a = mix_comps,
w = W,
y = "y",
direction = "positive",
w_stack = w_stack,
fold = 1,
max_iter = 1,
verbose = FALSE,
parallel = FALSE,
seed = 6442
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.