prune.path | R Documentation |
Using a single fitted logic decision tree, the cost-complexity pruning path containing the ideal subtree for a certain complexity penalty can be computed.
prune.path(pet, y, Z)
pet |
A fitted logic decision tree. This can be extracted from a
|
y |
Training outcomes for potentially refitting regression models in
the leaves. This can be extracted from a |
Z |
Continuous training predictors for potentially refitting regression
models in the leaves. This can be extracted from a |
This is mainly a helper function for cv.prune
and should only
be used by the user if manual pruning is preferred.
More details are given in cv.prune
.
Two lists. The first contains the sequence of complexity penalties
alpha. The second list contains the corresponding logic decision
trees which can then be substituted in an already fitted
logicDT
model, e.g., using
model$pet <- result[[2]][[i]]
where result
is the returned
object from this function and i
is the chosen tree index.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.