View source: R/fit_iterative_mix_rule_backfitting.R
fit_mix_rule_backfitting | R Documentation |
Iteratively Backfit a Super Learner, h(x) = Y|W, and an Ensemble Decision Algorithm, g(x), Y|M_x until Convergence.
fit_mix_rule_backfitting(
at,
a,
w,
y,
direction,
w_stack,
fold,
max_iter,
verbose,
parallel_cv,
seed
)
at |
Training dataframe |
a |
Variable names in the mixture |
w |
Variable names in the covariates |
y |
Variable name for the outcome |
direction |
Positive/negative - max or min coefficient to keep in the ensemble |
w_stack |
Stack of algorithms made in SL 3 used in ensemble machine learning to fit Y|W |
fold |
Current fold in the cross-validation |
max_iter |
Max number of iterations of iterative backfitting algorithm |
verbose |
Run in verbose setting |
parallel_cv |
TRUE/FALSE indicator to parallelize cv |
seed |
Seed number for consistent results |
Performs an iterative backfitting algorithm to flexibly adjust for covariates W while finding the best fitting set of mixture rules to partition the space in M.
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_mix_rule_backfitting(
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.