Learn R Programming

fastAdaboost (version 1.0.0)

get_tree: Fetches a decision tree

Description

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

Usage

get_tree(object, tree_num)

Arguments

object
object of class adaboost
tree_num
integer describing the tree to get

Value

object of class rpart

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

See Also

adaboost

Examples

Run this code
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)

Run the code above in your browser using DataLab