tidyRules.rpart {tidyrules} | R Documentation |
Obtain rules as a tidy tibble from a rpart model
Description
Each row corresponds to a rule. A rule can be copied into 'dplyr::filter' to filter the observations corresponding to a rule
Usage
## S3 method for class 'rpart'
tidyRules(object, ...)
Arguments
object |
Fitted model object with rules |
... |
Other arguments (currently unused) |
Details
NOTE: For rpart rules, one should build the model without ordered factor variable. We recommend you to convert ordered factor to factor or integer class.
Optional named arguments:
language (string, default: "r"): language where the rules are parsable. The allowed options is one among: r, python, sql
Value
A tibble where each row corresponds to a rule. The columns are: support, confidence, lift, LHS, RHS
Author(s)
Amith Kumar U R, amith54@gmail.com
Examples
iris_rpart <- rpart::rpart(Species ~ .,data = iris)
tidyRules(iris_rpart)
[Package tidyrules version 0.1.5 Index]