giniIndex: Gini index measure

View source: R/gini.R

giniIndexR Documentation

Gini index measure

Description

Generates an evaluation function that calculates the gini index \insertCiteCeriani2012FSinR of discrete features (set measure). This function is called internally within the filterEvaluator function.

Usage

giniIndex()

Value

Returns a function that is used to generate an evaluation set measure using the Gini index 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 Gini Index
giniIndex_evaluator <- giniIndex()
# Evaluate the features (parameters: dataset, target variable and features)
giniIndex_evaluator(titanic_subset, "Survived", c("Class", "Sex", "Age"))


FSinR documentation built on Nov. 5, 2025, 5:24 p.m.