Gini | R Documentation |
Calculates the Gini index of a categorical variable for a given split (threshold) value of a numeric variable.
Gini(x, group, thres)
x |
A numeric vector |
group |
Categorical variable |
thres |
Threshold value to use for the split |
A data frame with Gini index before and after the split, as well as the gain and gain percent
Kuhn, M. & Johnson, K. (2013). Applied Predictive Modeling. Springer.
Witten, I. H., Frank, E. & Hall, M. A. (2011). Data Mining: Practical Machine Learning Tools and Techniques. Elsevier.
Gini(mtcars$mpg, mtcars$cyl, 15) Gini(mtcars$mpg, mtcars$cyl, 21) Gini(mtcars$mpg, mtcars$cyl, 25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.