Learn R Programming

mltools (version 0.3.4)

gini_impurities: Gini Impurities

Description

Identify group weighted gini impurities using pairs of columns within a dataset. Can be used to located hierarchical data, or 1-1 correspondences

Usage

gini_impurities(dt, wide = FALSE, verbose = FALSE)

Arguments

dt

A data.table with at least two columns

wide

Should the results be in wide format?

verbose

Should progress be printed to the screen?

Details

For pairs of columns (Var1, Var2) in a dataset, calculates the weighted gini impurity of Var2 relative to the groups determined by Var1

Examples

Run this code
# NOT RUN {
library(data.table)
gini_impurities(alien.train)
gini_impurities(alien.train, wide=TRUE)
# }

Run the code above in your browser using DataLab