check_rules {creditmodel}R Documentation

check rules

Description

get_ctree_rules This function is used to check rules.

Usage

check_rules(rules_list, test_dat, target = NULL, value = NULL)

Arguments

rules_list

A list of rules.

test_dat

A data.frame of test.

target

The name of target variable, default is NULL.

value

The name of value to gather.

Value

A data frame with tree rules and percent under each rule.

See Also

get_ctree_rules, rules_filter

Examples

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)
rules_list = get_ctree_rules(tree_fit = NULL, train_dat = dat_train[, 8:26],
                             target ="default.payment.next.month", test_dat = dat_test)[10:12,2]
check_rules(rules_list = rules_list, target = "default.payment.next.month",
test_dat = dat_test, value = NULL)


[Package creditmodel version 1.3.0 Index]