SSELoss Class Reference

The SSE (Sum of Squared Errors) loss is a loss function to measure the quality of prediction of response values present in the node of each xgboost tree. More...

Public Member Functions

 SSELoss ()
 
 SSELoss (const double alpha, const double lambda)
 
double Evaluate (const size_t begin, const size_t end)
 Calculates the gain from begin to end. More...

 
template<bool UseWeights, typename MatType , typename WeightVecType >
double Evaluate (const MatType &input, const WeightVecType &)
 Calculates the gain of the node before splitting. More...

 
template
<
typename
VecType
>
VecType::elem_type InitialPrediction (const VecType &values)
 Returns the initial predition for gradient boosting. More...

 
template
<
typename
MatType
,
typename
WeightVecType
>
double OutputLeafValue (const MatType &, const WeightVecType &)
 Returns the output value for the leaf in the tree. More...

 

Detailed Description

The SSE (Sum of Squared Errors) loss is a loss function to measure the quality of prediction of response values present in the node of each xgboost tree.

It is also a good measure to compare the spread of two distributions. We will try to minimize this value while training.

Loss = 1 / 2 * (Observed - Predicted)^2

Definition at line 29 of file sse_loss.hpp.

Constructor & Destructor Documentation

◆ SSELoss() [1/2]

SSELoss ( )
inline

Definition at line 33 of file sse_loss.hpp.

◆ SSELoss() [2/2]

SSELoss ( const double  alpha,
const double  lambda 
)
inline

Definition at line 35 of file sse_loss.hpp.

Member Function Documentation

◆ Evaluate() [1/2]

double Evaluate ( const size_t  begin,
const size_t  end 
)
inline

Calculates the gain from begin to end.

Parameters
beginThe begin index to calculate gain.
endThe end index to calculate gain.

Definition at line 70 of file sse_loss.hpp.

◆ Evaluate() [2/2]

double Evaluate ( const MatType &  input,
const WeightVecType &   
)
inline

Calculates the gain of the node before splitting.

It also initializes the gradients and hessians used later for finding split. UseWeights and weights are ignored here. These are just to make the API consistent.

Parameters
inputThis is a 2D matrix. The first row stores the true observed values and the second row stores the prediction at the current step of boosting.

Definition at line 87 of file sse_loss.hpp.

◆ InitialPrediction()

VecType::elem_type InitialPrediction ( const VecType &  values)
inline

Returns the initial predition for gradient boosting.

Definition at line 45 of file sse_loss.hpp.

◆ OutputLeafValue()

double OutputLeafValue ( const MatType &  ,
const WeightVecType &   
)
inline

Returns the output value for the leaf in the tree.

Definition at line 58 of file sse_loss.hpp.


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