get_tree_breaks {creditmodel} | R Documentation |
Getting the breaks for terminal nodes from decision tree
Description
get_tree_breaks
is for generating initial braks by decision tree for a numerical or nominal variable.
The get_breaks
function is a simpler wrapper for get_tree_breaks
.
Usage
get_tree_breaks(
dat,
x,
target,
pos_flag = NULL,
tree_control = list(p = 0.02, cp = 1e-06, xval = 5, maxdepth = 10),
sp_values = NULL
)
Arguments
dat |
A data frame with x and target. |
x |
name of variable to cut breaks by tree. |
target |
The name of target variable. |
pos_flag |
The value of positive class of target variable, default: "1". |
tree_control |
the list of parameters to control cutting initial breaks by decision tree.
|
sp_values |
A list of special value. Default: NULL. |
See Also
Examples
#tree breaks
tree_control = list(p = 0.02, cp = 0.000001, xval = 5, maxdepth = 10)
tree_breaks = get_tree_breaks(dat = UCICreditCard, x = "MARRIAGE",
target = "default.payment.next.month", tree_control = tree_control)