prune.path: Pruning path of a logic decision tree

View source: R/pruning.R

prune.pathR Documentation

Pruning path of a logic decision tree

Description

Using a single fitted logic decision tree, the cost-complexity pruning path containing the ideal subtree for a certain complexity penalty can be computed.

Usage

prune.path(pet, y, Z)

Arguments

pet

A fitted logic decision tree. This can be extracted from a logicDT model, e.g., using model$pet.

y

Training outcomes for potentially refitting regression models in the leaves. This can be extracted from a logicDT model, e.g., using model$y.

Z

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.

Details

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.

Value

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.


logicDT documentation built on Jan. 14, 2023, 5:06 p.m.