Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tree.control

Select Parameters for Tree


Description

A utility function for use with the control argument of tree.

Usage

tree.control(nobs, mincut = 5, minsize = 10, mindev = 0.01)

Arguments

nobs

The number of observations in the training set.

mincut

The minimum number of observations to include in either child node. This is a weighted quantity; the observational weights are used to compute the ‘number’. The default is 5.

minsize

The smallest allowed node size: a weighted quantity. The default is 10.

mindev

The within-node deviance must be at least this times that of the root node for the node to be split.

Details

This function produces default values of mincut and minsize, and ensures that mincut is at most half minsize.

To produce a tree that fits the data perfectly, set mindev = 0 and minsize = 2, if the limit on tree depth allows such a tree.

Value

A list:

mincut

The maximum of the input or default mincut and 1

minsize

The maximum of the input or default minsize and 2.

nmax

A estimate of the maximum number of nodes that might be grown.

nobs

The input nobs.

Note

The interpretation of mindev given here is that of Chambers and Hastie (1992, p. 415), and apparently not what is actually implemented in S. It seems S uses an absolute bound.

Author(s)

B. D. Ripley

References

Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See Also


tree

Classification and Regression Trees

v1.0-40
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre]
Initial release
2019-03-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.