rules_result {creditmodel}R Documentation

rules_result

Description

rules_result This function is used to get rules results.

Usage

rules_result(dat, rules_list, yes = "reject", no = "pass")

Arguments

dat

A data.frame

rules_list

A list of rules.

yes

Default is 'reject'.

no

Default is 'pass'.

Value

A vector with 'pass' and 'reject'.

See Also

get_ctree_rules, check_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)[1:3,2]
dat_test$rules_result = rules_result(rules_list = rules_list[3], dat = dat_test)


[Package creditmodel version 1.3.0 Index]