extract_params.gbm {aurelius}R Documentation

extract_params.gbm

Description

Extracts a parameters from an ensemble made by the gbm function

Usage

## S3 method for class 'gbm'
extract_params(object, which_tree = 1, ...)

Arguments

object

an object of class "gbm"

which_tree

the number of the tree to extract

...

further arguments passed to or from other methods

Value

a list that is extracted from the gbm object

Examples

dat <- data.frame(X1 = runif(100), 
                  X2 = rnorm(100)) 
dat$Y <- ((rexp(100,5) + 5 * dat$X1 - 4 * dat$X2) > 0)

bernoulli_model <- gbm::gbm(Y ~ X1 + X2, 
                            data = dat, 
                            distribution = 'bernoulli')
my_tree <- extract_params(bernoulli_model, 1)

[Package aurelius version 0.8.4 Index]