Static class, used to calculate DCG score.
More...
#include <metric.h>
|
|
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.
|
| |
Static class, used to calculate DCG score.
◆ 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
-
| ks | The positions to evaluate |
| label | Pointer of label |
| score | Pointer of score |
| num_data | Number of data |
| out | Output result |
◆ CalDCGAtK()
Calculate the DCG score at position k.
- Parameters
-
| k | The position to evaluate |
| label | Pointer of label |
| score | Pointer of score |
| num_data | Number 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
-
| ks | The positions want to eval at |
| label | Pointer of label |
| num_data | Number of data |
| out | Output result |
◆ CalMaxDCGAtK()
Calculate the Max DCG score at position k.
- Parameters
-
| k | The position want to eval at |
| label | Pointer of label |
| num_data | Number of data |
- Returns
- The max DCG score
◆ CheckLabel()
Check the label range for NDCG and lambdarank.
- Parameters
-
| label | Pointer of label |
| num_data | Number of data |
◆ GetDiscount()
| static double LightGBM::DCGCalculator::GetDiscount |
( |
data_size_t |
k | ) |
|
|
inlinestatic |
Get discount score of position k.
- Parameters
-
- Returns
- The discount of this position
◆ Init()
| void LightGBM::DCGCalculator::Init |
( |
const std::vector< double > & |
label_gain | ) |
|
|
static |
Initial logic.
- Parameters
-
| label_gain | Gain for labels, default is 2^i - 1 |
The documentation for this class was generated from the following files:
- External/LightGBM_2.2.3/LightGBM-2.2.3/include/LightGBM/metric.h
- External/LightGBM_2.2.3/LightGBM-2.2.3/src/metric/dcg_calculator.cpp