powered by
Discretize numeric variable by maximizing the gain ratio between each bucket and the target variable.
discretize_rgr(input, target, min_perc_bins = 0.1, max_n_bins = 5)
discretized variable (factor)
numeric input vector to discretize
character or factor multi-calss target variable
minimum percetange of rows for each split or segment (controls the sample size), 0,1 (or 10 percent) as default
maximum number of bins or segments to split the input variable, 5 bins as default
# \donttest{ library(funModeling) data=heart_disease input=data$oldpeak target=as.character(data$has_heart_disease) input2=discretize_rgr(input, target) # checking: summary(input2) # }
Run the code above in your browser using DataLab