Skip to contents

Plot a conftree

Usage

# S3 method for class 'conftree'
plot(x, ...)

Arguments

x

(conftree)
tree containing detected subgroups.

...

additional arguments.

Value

The plot.

Examples

library(tidymodels)
#> ── Attaching packages ────────────────────────────────────── tidymodels 1.2.0 ──
#>  broom        1.0.6      recipes      1.1.0
#>  dials        1.3.0      rsample      1.2.1
#>  dplyr        1.1.4      tibble       3.2.1
#>  ggplot2      3.5.1      tidyr        1.3.1
#>  infer        1.0.7      tune         1.2.1
#>  modeldata    1.4.0      workflows    1.1.4
#>  parsnip      1.2.1      workflowsets 1.1.0
#>  purrr        1.0.2      yardstick    1.3.1
#> ── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
#>  purrr::discard() masks scales::discard()
#>  dplyr::filter()  masks stats::filter()
#>  dplyr::lag()     masks stats::lag()
#>  recipes::step()  masks stats::step()
#>  Use tidymodels_prefer() to resolve common conflicts.
library(ranger)
data(bikes)
set.seed(1234)
randforest <- rand_forest(trees = 200, min_n = 5) %>%
  set_mode("regression") %>%
  set_engine("ranger")
groups <- r2p(
  data = bikes,
  target = "count",
  learner = randforest,
  cv_folds = 2,
  alpha = 0.05,
  gamma = 0.2,
  lambda = 0.5,
  max_groups = 3
)
#> Error in n + 1: non-numeric argument to binary operator
plot(groups)
#> Error in UseMethod("groups"): no applicable method for 'groups' applied to an object of class "c('double', 'numeric')"