gainRatio: The gain ratio measure

View source: R/entropy.R

gainRatioR Documentation

The gain ratio measure

Description

Generates an evaluation function that calculates the gain ratio value \insertCiteQuinlan1986FSinR, using the information theory (set measure). This function is called internally within the filterEvaluator function.

Usage

gainRatio()

Value

Returns a function that is used to generate an evaluation set measure using the gain ratio value for the selected features.

Author(s)

Adan M. Rodriguez

References

\insertAllCited

Examples

 

## The direct application of this function is an advanced use that consists of using this 
# function directly to evaluate a set of features
## Classification problem
data("Titanic")
titanic <- as.data.frame(Titanic)

# A discrete dataset is used (in this case we use only several discrete columns)
titanic_subset <- titanic[, c("Class", "Sex", "Age", "Survived")]

# Generate the evaluation function with Gain Ratio
gr_evaluator <- gainRatio()
# Evaluate the features (parameters: dataset, target variable and features)
gr_evaluator(titanic_subset, "Survived", c("Class", "Sex", "Age"))


FSinR documentation built on Dec. 1, 2025, 9:08 a.m.