plot-forestry function

visualize a tree

visualize a tree

plots a tree in the forest.

## S3 method for class 'forestry' plot(x, tree.id = 1, print.meta_dta = FALSE, beta.char.len = 30, ...)

Arguments

  • x: A forestry x.
  • tree.id: Specifies the tree number that should be visulaized.
  • print.meta_dta: Should the data for the plot be printed?
  • beta.char.len: The length of the beta values in leaf node representation.
  • ...: additional arguments that are not used.

Examples

set.seed(292315) rf <- forestry(x = iris[,-1], y = iris[, 1]) plot(x = rf) plot(x = rf, tree.id = 2) plot(x = rf, tree.id = 500) ridge_rf <- forestry( x = iris[,-1], y = iris[, 1], replace = FALSE, nodesizeStrictSpl = 10, mtry = 4, ntree = 10, minSplitGain = .004, linear = TRUE, overfitPenalty = 1.65, linFeats = 1:2) plot(x = ridge_rf) plot(x = ridge_rf, tree.id = 2) plot(x = ridge_rf, tree.id = 10)
  • Maintainer: Theo Saarinen
  • License: GPL (>= 3) | file LICENSE
  • Last published: 2025-03-15