set_validation_data | R Documentation |
validation_data
to a rulelistReturns a rulelist with three new attributes set:
validation_data
, y_name
and weight
. Methods such as
augment, calculate,
prune, reorder require this to be set.
set_validation_data(x, validation_data, y_name, weight = 1)
x |
A rulelist |
validation_data |
(dataframe) Data to used for computing some metrics.
It is expected to contain |
y_name |
(string) Name of the dependent variable column. |
weight |
(non-negative numeric vector, default: 1) Weight per
observation/row of |
A rulelist with some extra attributes set.
rulelist, tidy, augment, predict, calculate, prune, reorder
Other Core Rulelist Utility:
set_keys()
att = modeldata::attrition
set.seed(100)
index = sample(c(TRUE, FALSE), nrow(att), replace = TRUE)
model_c5 = C50::C5.0(Attrition ~., data = att[index, ], rules = TRUE)
tidy_c5 = tidy(model_c5)
tidy_c5
tidy_c5_2 = set_validation_data(tidy_c5,
validation_data = att[!index, ],
y_name = "Attrition",
weight = 1 # default
)
tidy_c5_2
tidy_c5 # not altered
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.