Description Usage Arguments Details Examples
View source: R/gini_impurity.R
Calculates the Gini Impurity of a set
| 1 | gini_impurity(vals)
 | 
| vals | A vector of values. Values can be given as raw instances like c("red", "red", "blue", "green") or as a named vector of class frequencies like c(red=2, blue=1, green=1) | 
Gini Impurity is a measure of how often a randomly chosen element from a set would be incorrectly labeled if it was randomly labeled according to the distribution of labels in the set.
| 1 2 | gini_impurity(c("red", "red", "blue", "green"))
gini_impurity(c(red=2, blue=1, green=1))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.