
get_ctree_rules
This function is used to desision tree rules and percentage of 1 under each rule.
get_ctree_rules(
tree_fit = NULL,
train_dat = NULL,
target = NULL,
test_dat = NULL,
tree_control = list(p = 0.05, cp = 0.0001, xval = 1, maxdepth = 10),
seed = 46
)
A tree model object.
A data.frame of train.
The name of target variable.
A data.frame of test.
the list of parameters to control cutting initial breaks by decision tree.
Random number seed. Default is 46.
A data frame with tree rules and 1 percent under each rule.
# NOT RUN {
train_test = train_test_split(UCICreditCard, split_type = "Random", prop = 0.8, save_data = FALSE)
dat_train = train_test$train
dat_test = train_test$test
dat_train$default.payment.next.month = as.numeric(dat_train$default.payment.next.month)
get_ctree_rules(tree_fit = NULL, train_dat = dat_train[, 8:26],
target ="default.payment.next.month", test_dat = dat_test)
# }
Run the code above in your browser using DataLab