Learn R Programming

grmtree (version 0.1.0)

grmforest.control: Control Parameters for GRM Forest

Description

Creates a control object for grmforest containing parameters that control the forest growing process including sampling, tree growing, and error handling.

Usage

grmforest.control(
  n_tree = 100,
  sampling = "bootstrap",
  sample_fraction = 0.632,
  mtry = NULL,
  remove_dead_trees = TRUE,
  control = grmtree.control(),
  alpha = 0.05,
  minbucket = 20,
  seed = NULL
)

Value

A list of class grmforest_control containing:

n_tree

Number of trees

sampling

Sampling method

sample_fraction

Sample fraction

mtry

Number of variables to try at each split

remove_dead_trees

Whether to remove failed trees

control

Tree control parameters

seed

Random seed

Arguments

n_tree

Number of trees in the forest (default: 100).

sampling

Sampling method: "bootstrap" (with replacement) or "subsample" (without replacement) (default: "bootstrap").

sample_fraction

Fraction of data to sample for each tree (default: 0.632).

mtry

Number of variables randomly sampled as candidates at each split. If NULL, all variables are considered (default: NULL).

remove_dead_trees

Logical indicating whether to remove trees that encounter errors during fitting (default: TRUE).

control

Control parameters for individual trees created by grmtree.control().

alpha

Significance level for splitting (default: 0.05).

minbucket

Minimum number of observations in terminal nodes (default: 20).

seed

Random seed for reproducibility (default: NULL).

See Also

grmtree.control creates a control object for grmtree, plot.grmtree creates plot for the grmtree object, grmforest for GRM Forests,

Examples

Run this code
library(grmtree)
# Control with 50 trees using subsampling
ctrl <- grmforest.control(n_tree = 50, sampling = "subsample")

# Control with specific tree parameters
ctrl <- grmforest.control(
  control = grmtree.control(minbucket = 30, alpha = 0.01)
)

Run the code above in your browser using DataLab