intree {riAFTBART} | R Documentation |
Interpreting Tree Ensembles with inTrees
Description
The inTrees (interpretable trees) framework that extracts, measures, prunes and selects rules from a tree ensemble. All the codes we use are from the inTrees github repository to act as a work around method since package inTrees was removed from the CRAN repository.
Usage
intree(X, Y, ntree, typeDecay = 2, digits, n_rule)
Arguments
X |
A matrix indicating the predictor variables. |
Y |
A response vector. If a factor, classification is assumed, otherwise regression is assumed. |
ntree |
Number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times. |
typeDecay |
An integer of 1 or 2. 1 representing relative error and 2 representing error. The default is set to 2. |
digits |
An integer indicating the digits for rounding in Intrees. |
n_rule |
An integer indicating the minimum number of rules to consider in Intrees. |
Value
A matrix including a set of relevant and non-redundant rules, and their metrics
Examples
X <- within(iris,rm("Species")); Y <- iris[,"Species"]
intree_result <- intree(X, Y, ntree=100, digits = 3, n_rule = 2000)