Description Usage Arguments See Also Examples
View source: R/variable_binning.R
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
.
1 2 3 4 5 6 7 8 | 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
)
|
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. |
1 2 3 4 | #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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.