mlpack  master
Static Public Member Functions | List of all members
mlpack::tree::GiniGain Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

template<typename RowType >
static double mlpack::tree::GiniGain::Evaluate ( const RowType &  labels,
const size_t  numClasses 
)
inlinestatic

Evaluate the Gini impurity on the given set of labels.

RowType should be an Armadillo vector that holds size_t objects.

Parameters
labelsSet of labels to evaluate Gini impurity on.
numClassesNumber of classes in the dataset.

Definition at line 38 of file gini_gain.hpp.

static double mlpack::tree::GiniGain::Range ( const size_t  numClasses)
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.)

Parameters
numClassesNumber of classes in the dataset.

Definition at line 68 of file gini_gain.hpp.


The documentation for this class was generated from the following file: