mlpack
master
|
The Gini gain, a measure of set purity usable as a fitness function (FitnessFunction) for decision trees. More...
Static Public Member Functions | |
template<typename RowType > | |
static double | Evaluate (const RowType &labels, const size_t numClasses) |
Evaluate the Gini impurity on the given set of labels. More... | |
static double | Range (const size_t numClasses) |
Return the range of the Gini impurity for the given number of classes. More... | |
The Gini gain, a measure of set purity usable as a fitness function (FitnessFunction) for decision trees.
This is the exact same thing as the well-known Gini impurity, but negated—since the decision tree will be trying to maximize gain (and the Gini impurity would need to be minimized).
Definition at line 27 of file gini_gain.hpp.
|
inlinestatic |
Evaluate the Gini impurity on the given set of labels.
RowType should be an Armadillo vector that holds size_t objects.
labels | Set of labels to evaluate Gini impurity on. |
numClasses | Number of classes in the dataset. |
Definition at line 38 of file gini_gain.hpp.
|
inlinestatic |
Return the range of the Gini impurity for the given number of classes.
(That is, the difference between the maximum possible value and the minimum possible value.)
numClasses | Number of classes in the dataset. |
Definition at line 68 of file gini_gain.hpp.