treelm: Tree to linear model

Description Usage Arguments Details Value Author(s) Examples

View source: R/treelm.R

Description

The treelm function transforms the fitted rpart or ctree object into a design matrix representing the tree structure. The default encoding follows from Michael LeBlanc & Robert Tibshirani (1998) Monotone Shrinkage of Trees, Journal of Computational and Graphical Statistics, 7:4, 417-433, DOI: 10.1080/10618600.1998.10474786

Usage

1
treelm(model)

Arguments

model

a fitted rpart object or a fitted ctree model

Details

Represent a fitted regression or classification tree as an ANOVA model

Value

A list containing the design matrix

Author(s)

Ian Frankenburg

Examples

1
2
3
4
5
6
7
8
## Not run: 
fit <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
treelm(fit)

fit <- ctree(Kyphosis ~ Age + Number + Start, data = kyphosis)
treelm(fit)

## End(Not run)

ian-frankenburg/treeLM documentation built on Dec. 16, 2020, 4:25 a.m.