This function is usually used to assess the quality of ranking.
Calculation principles
The calculation of this function consists of the following steps:
-
The objects in each group are sorted in descending order of predicted relevancies (ai).
-
The DCG metric is calculated for each group (group∈groups) with sorted objects (see step 1).
The calculation principle depends on the specified value of the type
and denominator
parameters:
type/denominator |
LogPosition |
Position |
Base |
DCG(group,top)=i=1∑toplog2(i+1)tg(i,group) |
DCG(group,top)=i=1∑topitg(i,group) |
Exp |
DCG(group,top)=i=1∑toplog2(i+1)2tg(i,group)−1 |
DCG(group,top)=i=1∑topi2tg(i,group)−1 |
tg(i,group) is the label value for the i-th object in the group.
-
The objects in each group are sorted in descending order of target relevancies (ti).
-
The iDCG metric is calculated for each group (group∈groups) with sorted objects (see step 3).
The calculation principle depends on the specified value of the type
and denominator
parameters:
type/denominator |
LogPosition |
Position |
Base |
IDCG(group,top)=i=1∑toplog2(i+1)tg(i,group) |
IDCG(group,top)=i=1∑topitg(i,group) |
Exp |
IDCG(group,top)=i=1∑toplog2(i+1)2tg(i,group)−1 |
IDCG(group,top)=i=1∑topi2tg(i,group)−1 |
-
The NDCG metric is calculated for each group:
nDCG(group,top)=iDCGDCG
-
The aggregated value of the metric for all groups is calculated as follows:
nDCG(top)=group∈groups∑wgroupgroup∈groups∑nDCG(group,top)∗wgroup
User-defined parameters
top
Description
The number of top samples in a group that are used to calculate the ranking metric. Top samples are either the samples with the largest approx values or the ones with the lowest target values if approx values are the same.
Default: –1 (all label values are used)
use_weights
Description
Use object/group weights to calculate metrics if the specified value is true
and set all weights to 1
regardless of the input data if the specified value is false
.
Default: true
type
Description
Metric calculation principles.
Possible values:
Default: Base
denominator
Description
Metric denominator type.
Possible values:
Default: LogPosition