initialize_veb_boost_tree: Initialize VEB-Boost Tree structure

View source: R/initialize_veb_boost_tree.R

initialize_veb_boost_treeR Documentation

Initialize VEB-Boost Tree structure

Description

Initializes a VEB-Boost tree object as the sum of products of nodes, where you can specify how many learners to add, and the multiplicative depth of each learner.

Usage

initialize_veb_boost_tree(
  learners,
  Y,
  k = 1,
  d = 1,
  weights = 1,
  family = c("gaussian", "binomial", "negative.binomial", "poisson.log1pexp",
    "aft.loglogistic", "ordinal.logistic", "multinomial.titsias"),
  exposure = NULL,
  my_class_index = NULL
)

Arguments

learners

is either a single "learner" object, or a list of k "learner" objects A learner object is comprised of: 1. a fit function $fitFunction: (X, Y, sigma2, currentFit) -> newFit (where a fit is a list that must contain $mu1, $mu2, and $KL_div) 2. a prediction function $predFunction: (X, fit, moment) -> posterior moment (1 or 2) 3. a constant check function $constCheckFunction: (fit) -> (TRUE/FALSE) to check if a fit is essentially constant 4. a current fit $currentFit: must contain $mu1 (first posterior moments), $mu2 (second posterior moments), and $KL_div (KL-divergence from q to prior) (can be NULL, at least to start) 5. a predictor object $X (whatever the $fitFunction and $predFunction take in), used for training (can be NULL, e.g. if using constLearner) 6. a predictor object $X_test (whatever the $fitFunction and $predFunction take in), used for testing (can be NULL)

Y

is a numeric vector response

k

is an integer, or a vector of integers of length length(learners), for how many terms are in the sum of nodes (for each learner)

d

is either an integer, or an integer vector of length k, or a list of integer vectors of length length(learners) (each element either an integer, or a vector of length k) for the multiplicative depth of each of the k terms NOTE: This can be dangerous. For example, if the fit starts out too large, then entire branhces will be fit to be exactly zero. When this happens, we end up dividing by 0 in places, and this results in NAs, -Inf, etc. USE AT YOUR OWN RISK

weights

is a vector of the same length as Y weighting the observations. Relative weights are used and we take care of the scaling for you

family

is what family the response is


stephenslab/VEB.Boost documentation built on July 2, 2023, 1 p.m.