get_concensus_rules.Rd
Returns a nested list of the concensus rules to define a cluster, given a partykit decision tree.
get_concensus_rules(tree)
tree | partykit::ctree fit decision tree |
---|
a nested list
level 1 of the nested list is the group being predicted. level 2 is either "all" or "majority". each element is a character vector.
#> List of 3 #> $ setosa :List of 2 #> ..$ all : chr "Petal.Length <= 1.9" #> ..$ majority: chr(0) #> $ versicolor:List of 2 #> ..$ all : chr [1:2] "Petal.Length > 1.9" "Petal.Width <= 1.7" #> ..$ majority: chr "Petal.Length <= 4.8" #> $ virginica :List of 2 #> ..$ all : chr [1:2] "Petal.Length > 1.9" "Petal.Width > 1.7" #> ..$ majority: chr(0) #> - attr(*, "class")= chr [1:2] "list" "concensus.rules"# List of 3 # $ setosa :List of 2 # ..$ all : chr "Petal.Length <= 1.9" # ..$ majority: chr(0) # $ versicolor:List of 2 # ..$ all : chr [1:2] "Petal.Length > 1.9" "Petal.Width <= 1.7" # ..$ majority: chr "Petal.Length <= 4.8" # $ virginica :List of 2 # ..$ all : chr [1:2] "Petal.Length > 1.9" "Petal.Width > 1.7" # ..$ majority: chr(0) # - attr(*, "class")= chr [1:2] "list" "concensus.rules"