show_rule() prints the logical expression that defines one rule of a
fitted model. The rule identifiers are in the label column of the rules
element of the model (see rule_ensemble-object).
Examples
if (rlang::is_installed("xgboost")) {
set.seed(1)
fit <- rule_ensemble(mpg ~ ., data = mtcars, trees = 5)
show_rule(fit, fit$rules$label[1])
}
#> Rule: "rule_01"
#> cyl < 6 & wt < 2.31999993
