get_tree: Fetches a decision tree

Description Usage Arguments Details Value See Also Examples

View source: R/get_tree.R

Description

returns a single weak decision tree classifier which is part of the strong classifier

Usage

1
get_tree(object, tree_num)

Arguments

object

object of class adaboost

tree_num

integer describing the tree to get

Details

returns an individual tree from the adaboost object This can provide the user with some clarity on the individual building blocks of the strong classifier

Value

object of class rpart

See Also

adaboost

Examples

1
2
3
4
fakedata <- data.frame( X=c(rnorm(100,0,1),rnorm(100,1,1)), Y=c(rep(0,100),rep(1,100) ) )
fakedata$Y <- factor(fakedata$Y)
test_adaboost <- adaboost(Y~X, fakedata, 10)
tree <- get_tree(test_adaboost,5)

Example output



fastAdaboost documentation built on May 2, 2019, 3:33 p.m.