splitstats: Stats about a tree's splits.

Description Usage Arguments Value Examples

View source: R/splitstats.R

Description

Computes some quantities about the variables used in the splits of an itree object. This is new to itree.

Usage

1
splitstats(tree,featlist=NULL)

Arguments

tree

an itree object.

featlist

A list of features to compute statistics of. Typically set to NULL, in which case we figure out the features using the itree object itself.

Value

A data frame with each row being a feature and each column being a statistic about how that feature is used in the tree.

Examples

1
2
3
4
require(mlbench); data(BostonHousing)
#fit a tree:
cart <- itree(medv~.,BostonHousing,minsplit=25,minbucket=25,cp=0)
splitstats(cart)

Example output

itree is based on the code of rpart.
Bug reports should be directed to this package's maintainer, not rparts'.

Loading required package: mlbench
       var split.ct total.inv.depth total.node.size isroot isdepth1
1     crim        2      0.11654527      0.10512821      0        0
2       zn        0      0.00000000      0.00000000      0        0
3    indus        0      0.00000000      0.00000000      0        0
4     chas        0      0.00000000      0.00000000      0        0
5      nox        1      0.03121748      0.02222222      0        0
6       rm        3      0.36420395      0.35769231      1        1
7      age        1      0.03642040      0.03547009      0        0
8      dis        3      0.14203954      0.12820513      0        0
9      rad        0      0.00000000      0.00000000      0        0
10     tax        0      0.00000000      0.00000000      0        0
11 ptratio        0      0.00000000      0.00000000      0        0
12       b        0      0.00000000      0.00000000      0        0
13   lstat        5      0.30957336      0.35128205      0        1

itree documentation built on May 2, 2019, 7:25 a.m.

Related to splitstats in itree...