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)
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.
A fitted logic decision tree. This can be extracted from a
logicDT
model, e.g., using model$pet
.
Training outcomes for potentially refitting regression models in
the leaves. This can be extracted from a logicDT
model,
e.g., using model$y
.
Continuous training predictors for potentially refitting regression
models in the leaves. This can be extracted from a logicDT
model, e.g., using model$Z
. If no continuous covariable was used in
fitting the model, Z = model$Z = NULL
should be specified.
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
.