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

The MAD (Mean absolute deviation) gain, is a measure of set purity based on the deviation of dependent values present in the node. More...

#include <mad_gain.hpp>

Static Public Member Functions

template<bool UseWeights, typename VecType , typename WeightVecType >
static double Evaluate (const VecType &values, const WeightVecType &weights, const size_t begin, const size_t end)
 Evaluate the mean absolute deviation gain from begin to end index. More...
 
template<bool UseWeights, typename VecType , typename WeightVecType >
static double Evaluate (const VecType &values, const WeightVecType &weights)
 Evaluate the MAD gain on the complete vector. More...
 

Detailed Description

The MAD (Mean absolute deviation) gain, is a measure of set purity based on the deviation of dependent values present in the node.

This is same thing as negation of deviation of dependent variable from the mean in the node as we will try to maximize this quantity to maximize gain (and thus reduce absolute deviation of a set).

Member Function Documentation

◆ Evaluate() [1/2]

template<bool UseWeights, typename VecType , typename WeightVecType >
static double mlpack::tree::MADGain::Evaluate ( const VecType &  values,
const WeightVecType &  weights,
const size_t  begin,
const size_t  end 
)
inlinestatic

Evaluate the mean absolute deviation gain from begin to end index.

Note that gain can be slightly greater than 0 due to floating-point representation issues. Thus if you are checking for perfect fit, be sure to use 'gain >= 0.0'. Not 'gain == 0.0'. The values should always be of type arma::Row<double> or arma::rowvec.

Parameters
valuesSet of values to evaluate MAD gain on.
weightsWeights associated to each value.
beginStart index.
endEnd index.

◆ Evaluate() [2/2]

template<bool UseWeights, typename VecType , typename WeightVecType >
static double mlpack::tree::MADGain::Evaluate ( const VecType &  values,
const WeightVecType &  weights 
)
inlinestatic

Evaluate the MAD gain on the complete vector.

Parameters
valuesSet of values to evaluate MAD gain on.
weightsWeights associated to each value.

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