distAtNodes: Distribution at Nodes

Description Usage Arguments Value Note Examples

Description

Easily find the distribtution of the response variable at each of the nodes of a classification tree.

Usage

1
distAtNodes(mod, df, resp_varname)

Arguments

mod

A tree model constructed by the tree package.

df

A data frame (usually the training set, quiz set or test set).

resp_varname

The name of the response variable, as a character string.

Value

A table object.

Note

For more details on use, consult http://statistics.rainandrhino.org/tigerTree/distAtNodes.html

Examples

1
2
3
4
5
6
7
8
## Not run: 
dfs <- divideTrainTest(seed = 3030, prop.train = 0.67, data = iris)
irisTrain <- dfs$train
irisTest <- dfs$test
tr.mod <- tree(Species ~ ., data = irisTrain)
distAtNodes(tr.mod, df = irisTest, resp_varname = "Species")

## End(Not run)

homerhanumat/tigerTree documentation built on May 17, 2019, 4:51 p.m.