tidy.rpart {tidyrules}R Documentation

Get the rulelist from a rpart model

Description

Each row corresponds to a rule

Usage

## S3 method for class 'rpart'
tidy(x, ...)

Arguments

x

rpart::rpart model

...

Other arguments (currently unused)

Details

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:

For rpart::rpart regression(anova) model:

Value

A rulelist object

See Also

rulelist, tidy, augment, predict, calculate, prune, reorder

Other Core Tidy Utility: tidy(), tidy.C5.0(), tidy.cubist()

Examples

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)


[Package tidyrules version 0.2.7 Index]