simplify_rules: Simplify rules to the minimal defining set

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Tree algorithms returns nested, redundant rule sets. This function simplify the rules keeping the shortest condition set required to univocally identify the partition.

Usage

1

Arguments

rules

A vector of rules or a list of rule components.

Value

A vector or a list, based on the input, with the smallest set of rules that identifies a partition.

Examples

1
2
3
4
5
6
7
8
tree <- ctree(Sepal.Length ~ Species + Sepal.Width, iris)
rules <- tidy_tree()
simplify_rules(rules$rule)

## Works also with a list of conditions

#' rules <- tidy_tree(rule_as_text = FALSE)
simplify_rules(rules$rule)

bakaburg1/tidytrees documentation built on Dec. 19, 2021, 6:40 a.m.