discretize_rgr: Variable discretization by gain ratio maximization

discretize_rgrR Documentation

Variable discretization by gain ratio maximization

Description

Discretize numeric variable by maximizing the gain ratio between each bucket and the target variable.

Usage

discretize_rgr(input, target, min_perc_bins = 0.1, max_n_bins = 5)

Arguments

input

numeric input vector to discretize

target

character or factor multi-calss target variable

min_perc_bins

minimum percetange of rows for each split or segment (controls the sample size), 0,1 (or 10 percent) as default

max_n_bins

maximum number of bins or segments to split the input variable, 5 bins as default

Value

discretized variable (factor)

Examples


library(funModeling)
data=heart_disease
input=data$oldpeak
target=as.character(data$has_heart_disease)

input2=discretize_rgr(input, target)

# checking:
summary(input2)


funModeling documentation built on May 29, 2024, 3:24 a.m.