tidy.rpart | R Documentation |
Each row corresponds to a rule
## S3 method for class 'rpart'
tidy(x, ...)
x |
rpart::rpart model |
... |
Other arguments (currently unused) |
For rpart rules, one should build the model without ordered factor variable. We recommend you to convert ordered factor to factor or integer class.
For rpart::rpart classification model:
Output columns are: rule_nbr
, LHS
, RHS
, support
, confidence
, lift
.
The rules are sorted in this order: desc(confidence)
, desc(lift)
,
desc(support)
.
For rpart::rpart regression(anova) model:
Output columns are: rule_nbr
, LHS
, RHS
, support
.
The rules are sorted in this order: desc(support)
.
A rulelist object
rulelist, tidy, augment, predict, calculate, prune, reorder
Other Core Tidy Utility:
tidy()
,
tidy.C5.0()
,
tidy.cubist()
model_class_rpart = rpart::rpart(Species ~ ., data = iris)
tidy(model_class_rpart)
model_regr_rpart = rpart::rpart(Sepal.Length ~ ., data = iris)
tidy(model_regr_rpart)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.