Medial Code Documentation
Loading...
Searching...
No Matches
Static Public Member Functions
LightGBM::DCGCalculator Class Reference

Static class, used to calculate DCG score. More...

#include <metric.h>

Static Public Member Functions

static void DefaultEvalAt (std::vector< int > *eval_at)
 
static void DefaultLabelGain (std::vector< double > *label_gain)
 
static void Init (const std::vector< double > &label_gain)
 Initial logic.
 
static double CalDCGAtK (data_size_t k, const label_t *label, const double *score, data_size_t num_data)
 Calculate the DCG score at position k.
 
static void CalDCG (const std::vector< data_size_t > &ks, const label_t *label, const double *score, data_size_t num_data, std::vector< double > *out)
 Calculate the DCG score at multi position.
 
static double CalMaxDCGAtK (data_size_t k, const label_t *label, data_size_t num_data)
 Calculate the Max DCG score at position k.
 
static void CheckLabel (const label_t *label, data_size_t num_data)
 Check the label range for NDCG and lambdarank.
 
static void CalMaxDCG (const std::vector< data_size_t > &ks, const label_t *label, data_size_t num_data, std::vector< double > *out)
 Calculate the Max DCG score at multi position.
 
static double GetDiscount (data_size_t k)
 Get discount score of position k.
 

Detailed Description

Static class, used to calculate DCG score.

Member Function Documentation

◆ CalDCG()

void LightGBM::DCGCalculator::CalDCG ( const std::vector< data_size_t > &  ks,
const label_t label,
const double *  score,
data_size_t  num_data,
std::vector< double > *  out 
)
static

Calculate the DCG score at multi position.

Parameters
ksThe positions to evaluate
labelPointer of label
scorePointer of score
num_dataNumber of data
outOutput result

◆ CalDCGAtK()

double LightGBM::DCGCalculator::CalDCGAtK ( data_size_t  k,
const label_t label,
const double *  score,
data_size_t  num_data 
)
static

Calculate the DCG score at position k.

Parameters
kThe position to evaluate
labelPointer of label
scorePointer of score
num_dataNumber of data
Returns
The DCG score

◆ CalMaxDCG()

void LightGBM::DCGCalculator::CalMaxDCG ( const std::vector< data_size_t > &  ks,
const label_t label,
data_size_t  num_data,
std::vector< double > *  out 
)
static

Calculate the Max DCG score at multi position.

Parameters
ksThe positions want to eval at
labelPointer of label
num_dataNumber of data
outOutput result

◆ CalMaxDCGAtK()

double LightGBM::DCGCalculator::CalMaxDCGAtK ( data_size_t  k,
const label_t label,
data_size_t  num_data 
)
static

Calculate the Max DCG score at position k.

Parameters
kThe position want to eval at
labelPointer of label
num_dataNumber of data
Returns
The max DCG score

◆ CheckLabel()

void LightGBM::DCGCalculator::CheckLabel ( const label_t label,
data_size_t  num_data 
)
static

Check the label range for NDCG and lambdarank.

Parameters
labelPointer of label
num_dataNumber of data

◆ GetDiscount()

static double LightGBM::DCGCalculator::GetDiscount ( data_size_t  k)
inlinestatic

Get discount score of position k.

Parameters
kThe position
Returns
The discount of this position

◆ Init()

void LightGBM::DCGCalculator::Init ( const std::vector< double > &  label_gain)
static

Initial logic.

Parameters
label_gainGain for labels, default is 2^i - 1

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