Each row corresponds to a rule per trial_nbr

# S3 method for C5.0
tidy(x, ...)

Arguments

x

C50::C5.0 model fitted with rules = TRUE

...

Other arguments (See details)

Value

A rulelist object

Details

  • The output columns are: rule_nbr, trial_nbr, LHS, RHS, support, confidence, lift.

  • Rules per trial_nbr are sorted in this order: desc(confidence), desc(lift), desc(support).

Optional named arguments:

  • laplace (flag, default: TRUE) is supported. This computes confidence with laplace correction as documented under 'Rulesets' here: C5 doc.

See also

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

Other Core Tidy Utility: tidy(), tidy.cubist(), tidy.rpart()

Examples

model_c5 = C50::C5.0(Attrition ~., data = modeldata::attrition, rules = TRUE)
tidy(model_c5)
#> ---- Rulelist --------------------------------
#> ▶ Keys: trial_nbr
#> ▶ Number of distinct keys: 1
#> ▶ Number of rules: 24
#> ▶ Model type: C5
#> ▶ Estimation type: classification
#> ▶ Is validation data set: FALSE
#> 
#> 
#>    rule_nbr trial_nbr LHS                         RHS   support confidence  lift
#>       <int>     <int> <chr>                       <fct>   <int>      <dbl> <dbl>
#>  1        1         1 ( JobLevel <= 1 ) & ( Mont… Yes        16      0.944   5.9
#>  2        2         1 ( EnvironmentSatisfaction … No        521      0.941   1.1
#>  3        3         1 ( DailyRate <= 722 ) & ( J… Yes        13      0.933   5.8
#>  4        4         1 ( JobRole == 'Research_Sci… No        195      0.924   1.1
#>  5        5         1 ( EnvironmentSatisfaction … Yes         9      0.909   5.6
#>  6        6         1 ( EnvironmentSatisfaction … Yes         9      0.909   5.6
#>  7        7         1 ( JobRole %in% c('Laborato… Yes        14      0.875   5.4
#>  8        8         1 ( JobRole == 'Laboratory_T… Yes         6      0.875   5.4
#>  9        9         1 ( Department == 'Sales' ) … Yes        13      0.867   5.4
#> 10       10         1 ( TotalWorkingYears > 2 )   No       1347      0.864   1  
#> # ℹ 14 more rows
#> ----------------------------------------------