fit_min_ave_tree_algorithm: Fit minimum average tree

View source: R/fit_min_ave_tree.R

fit_min_ave_tree_algorithmR Documentation

Fit minimum average tree

Description

Fit minimum average tree

Usage

fit_min_ave_tree_algorithm(at, a, w, y, fold, parallel_cv, min_max, min_obs)

Arguments

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

Details

Fits the min ave tree

Value

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.

Examples

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
)

blind-contours/CVtreeMLE documentation built on June 22, 2024, 8:53 p.m.