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

Public Member Functions

template<bool UseWeights, typename ResponsesType , typename WeightsType >
double OutputLeafValue (const ResponsesType &responses, const WeightsType &weights)
 Returns the output value for each leaf node for prediction. More...

 

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

Definition at line 30 of file mad_gain.hpp.

Member Function Documentation

◆ Evaluate() [1/2]

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

Definition at line 46 of file mad_gain.hpp.

References Sum(), and WeightedSum().

◆ Evaluate() [2/2]

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

Definition at line 92 of file mad_gain.hpp.

◆ OutputLeafValue()

double OutputLeafValue ( const ResponsesType &  responses,
const WeightsType &  weights 
)
inline

Returns the output value for each leaf node for prediction.

The output value is calculated as the average of all the points in that leaf node. This calculation is specific to regression trees only.

Definition at line 108 of file mad_gain.hpp.

References Sum(), and WeightedSum().


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/decision_tree/mad_gain.hpp