axe-C5.0: Axing a C5.0.

Description Usage Arguments Value Examples

Description

C5.0 objects are created from the C50 package, which provides an interface to the C5.0 classification model. The models that can be generated include basic tree-based models as well as rule-based models.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'C5.0'
axe_call(x, verbose = FALSE, ...)

## S3 method for class 'C5.0'
axe_ctrl(x, verbose = FALSE, ...)

## S3 method for class 'C5.0'
axe_fitted(x, verbose = FALSE, ...)

Arguments

x

A model object.

verbose

Print information each time an axe method is executed. Notes how much memory is released and what functions are disabled. Default is FALSE.

...

Any additional arguments related to axing.

Value

Axed C5.0 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Load libraries
suppressWarnings(suppressMessages(library(parsnip)))
suppressWarnings(suppressMessages(library(rsample)))
suppressWarnings(suppressMessages(library(rpart)))

# Load data
set.seed(1234)
split <- initial_split(kyphosis, props = 9/10)
spine_train <- training(split)

# Create model and fit
c5_fit <- decision_tree(mode = "classification") %>%
  set_engine("C5.0") %>%
  fit(Kyphosis ~ ., data = spine_train)

out <- butcher(c5_fit, verbose = TRUE)

# Try another model from parsnip
c5_fit2 <- boost_tree(mode = "classification", trees = 100) %>%
  set_engine("C5.0") %>%
  fit(Kyphosis ~ ., data = spine_train)
out <- butcher(c5_fit2, verbose = TRUE)

# Create model object from original library
library(C50)
library(modeldata)
data(mlc_churn)
c5_fit3 <- C5.0(x = mlc_churn[, -20], y = mlc_churn$churn)
out <- butcher(c5_fit3, verbose = TRUE)

butcher documentation built on June 28, 2021, 9:08 a.m.