boostmtree.control: Create a control object for 'boostmtree'

View source: R/boostmtree_control.R

boostmtree.controlR Documentation

Create a control object for boostmtree

Description

Construct a control object used by boostmtree() to manage resampling, split search, reproducibility, and a few advanced fitting options.

Usage

boostmtree.control(
  ntree = 1,
  bootstrap = "by.root",
  bootstrap.fraction = 0.632,
  sample.matrix = NULL,
  nsplit = NULL,
  samptype = "swor",
  xvar.wt = NULL,
  case.wt = NULL,
  seed = NULL,
  cv.lambda = FALSE,
  cv.rho = TRUE
)

Arguments

ntree

Number of trees requested. The current implementation supports ntree = 1 only.

bootstrap

Resampling rule passed to the underlying tree learner. Recognized values are "by.root", "by.user", and "none". The default "by.root" creates out-of-bag subjects and is the recommended choice whenever cv.flag = TRUE or grow-object variable importance will be used.

bootstrap.fraction

Sampling fraction used to build the in-bag sample when bootstrap = "by.user" and sample.matrix is not supplied.

sample.matrix

Optional user-supplied in-bag sampling matrix with dimensions n x M. Entry [i, m] gives the in-bag count for subject i at boosting iteration m. When this is used together with cv.flag = TRUE, every column must contain at least one zero so that out-of-bag subjects are available.

nsplit

Optional limit on the number of candidate split points examined at each node. Smaller values can reduce computation.

samptype

Sampling type passed to the underlying tree learner.

xvar.wt

Optional split-variable weights.

case.wt

Optional case weights.

seed

Optional integer seed used to reproduce the random parts of tree fitting. This affects reproducibility only; it does not turn out-of-bag sampling on or off.

cv.lambda

Logical; should the CV path use the cross-validated mean when updating lambda?

cv.rho

Logical; should the CV path use the cross-validated mean when updating rho and phi?

Details

The control object separates routine model arguments such as M, k, and nu from lower-level options that control how the tree base learner is grown.

The most important option is bootstrap. In this package, out-of-bag subjects are used for the cross-validation path stored when cv.flag = TRUE, and for grow-object variable importance returned by vimp.boostmtree(). The default bootstrap = "by.root" is therefore usually the right choice. Setting bootstrap = "none" disables OOB sampling. That can be useful for deterministic in-bag fits and for workflows that rely on a separate held-out test set, but it is not suitable for OOB CV.

When cv.flag = TRUE, boostmtree() checks the requested control object before fitting. If the requested resampling rule would yield no out-of-bag subjects, the fit is adjusted back to the default OOB rule or the function stops with a clear message when a user-supplied sampling matrix is not compatible with OOB CV.

Value

An object of class "boostmtree.control".

See Also

boostmtree

Examples

## Default OOB-producing control object.
boostmtree.control(seed = 7)

## Deterministic in-bag fitting with no OOB subjects.
boostmtree.control(bootstrap = "none", seed = 7)

boostmtree documentation built on April 10, 2026, 9:10 a.m.