Each row corresponds to a rule per committee

# S3 method for cubist
tidy(x, ...)

Arguments

x

Cubist::cubist model

...

Other arguments (currently unused)

Value

A rulelist object

Details

  • The output columns are: rule_nbr, committee, LHS, RHS, support, mean, min, max, error.

  • Rules are sorted in this order per committee: error, desc(support)

See also

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

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

Examples

att = modeldata::attrition
cols_att    = setdiff(colnames(att), c("MonthlyIncome", "Attrition"))
model_cubist = Cubist::cubist(x = att[, cols_att],
                              y = att[["MonthlyIncome"]]
                              )
tidy(model_cubist)
#> ---- Rulelist --------------------------------
#> ▶ Keys: committee
#> ▶ Number of distinct keys: 1
#> ▶ Number of rules: 8
#> ▶ Model type: cubist
#> ▶ Estimation type: regression
#> ▶ Is validation data set: FALSE
#> 
#> 
#>   rule_nbr committee LHS                  RHS   support   mean   min   max error
#>      <int>     <int> <chr>                <chr>   <int>  <dbl> <dbl> <dbl> <dbl>
#> 1        1         1 ( JobLevel > 1 ) & … (-20…      57  4459   2272  5301  328.
#> 2        2         1 ( JobLevel > 4 )     (136…      69 19192. 18041 19999  416 
#> 3        3         1 ( JobRole %in% c('M… (-13…      26 12857. 11031 17603  517.
#> 4        4         1 ( JobLevel <= 1 )    (226…     543  2787.  1009  4968  559.
#> 5        5         1 ( JobLevel <= 4 ) &… (416…      87 15824  12061 17924  694.
#> 6        6         1 ( JobRole %in% c('H… (-11…     245  8469.  2592 13973  932.
#> 7        7         1 ( JobLevel > 1 ) & … (185…     387  6261.  2176  9998  995.
#> 8        8         1 ( JobLevel > 1 ) & … (-39…     124  4672.  2042  9724 1013.
#> ----------------------------------------------