tests/testthat/_snaps/c5.md

check_args() works

Code
  spec <- set_mode(set_engine(C5_rules(trees = c(1, 2, 3)), "C5.0"),
  "classification")
  fit(spec, Class ~ ., data = ad_data$ad_mod)
Condition
  Error in `fit()`:
  ! `tree` must be a whole number or `NULL`, not a double vector.
Code
  spec <- set_mode(set_engine(C5_rules(trees = 0), "C5.0"), "classification")
  res <- fit(spec, Class ~ ., data = ad_data$ad_mod)
Condition
  Warning:
  The number of trees should be `>= 1` and `<= 100`
  Truncating to 1.
Code
  spec <- set_mode(set_engine(C5_rules(trees = 1000), "C5.0"), "classification")
  res <- fit(spec, Class ~ ., data = ad_data$ad_mod)
Condition
  Warning:
  The number of trees should be `>= 1` and `<= 100`
  Truncating to 100.
Code
  spec <- set_mode(set_engine(C5_rules(min_n = c(1, 2, 3)), "C5.0"),
  "classification")
  fit(spec, Class ~ ., data = ad_data$ad_mod)
Condition
  Error in `fit()`:
  ! `min_n` must be a whole number or `NULL`, not a double vector.


Try the rules package in your browser

Any scripts or data that you put into this service are public.

rules documentation built on Jan. 27, 2026, 9:07 a.m.