The standard information gain criterion, used for calculating gain in decision trees. More...
Static Public Member Functions | |
template<bool UseWeights> | |
static double | Evaluate (const arma::Row< size_t > &labels, const size_t numClasses, const arma::Row< double > &weights) |
Given a set of labels, calculate the information gain of those labels. More... | |
template<bool UseWeights, typename CountType > | |
static double | EvaluatePtr (const CountType *counts, const size_t countLength, const CountType totalCount) |
Evaluate the information gain given a vector of class weight counts. More... | |
static double | Range (const size_t numClasses) |
Return the range of the information gain for the given number of classes. More... | |
The standard information gain criterion, used for calculating gain in decision trees.
Definition at line 25 of file information_gain.hpp.
|
inlinestatic |
Given a set of labels, calculate the information gain of those labels.
Note that it is possible that due to floating-point representation issues, it is possible that the gain returned can be very slightly greater than 0! Thus, if you are checking for a perfect fit, be sure to use 'gain >= 0.0' not 'gain == 0.0'.
labels | Labels of the dataset. |
numClasses | Number of classes in the dataset. |
weights | Weights associated with labels. |
Definition at line 60 of file information_gain.hpp.
|
inlinestatic |
Evaluate the information gain given a vector of class weight counts.
Definition at line 32 of file information_gain.hpp.
|
inlinestatic |
Return the range of the information gain 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 203 of file information_gain.hpp.