pruneForest function

Prune each tree in forest using a given complexity parameter.

Prune each tree in forest using a given complexity parameter.

Prunes each tree in the list forest$Trees according to the provided complexity parameter. Returns a new forest.

pruneForest(forest, cp)

Arguments

  • forest: A model returned by splineForest()
  • cp: The complexity parameter that will be used to prune each tree (see rpart package documentation for detailed description of complexity parameter)

Returns

A new spline forest model (named list) where each tree has been pruned to the desired level.

Examples

print(avSize(forest)) print(avSize(pruneForest(forest, cp=0.007))) print(avSize(pruneForest(forest, cp=0.01)))
  • Maintainer: Anna Neufeld
  • License: MIT + file LICENSE
  • Last published: 2019-07-18