RankingMetrics Class

Definition

Evaluation results for rankers.

public sealed class RankingMetrics
type RankingMetrics = class
Public NotInheritable Class RankingMetrics
Inheritance
RankingMetrics

Properties

DiscountedCumulativeGains

List of discounted cumulative gains (DCG), where the N-th element represents DCG@N. Discounted Cumulative Gain is the sum of the relevance gains up to the N-th position for all the instances i, normalized by the natural logarithm of the instance + 1. DCG is an increasing metric, with a higher value indicating a better model. Note that unlike the Wikipedia article, ML.NET uses the natural logarithm.

$DCG@N = \sum_{i = 1}^N \frac{g_i}{ln(i + 1)}$, where $g_i$ is the relevance gain at the i-th position.

NormalizedDiscountedCumulativeGains

List of normalized discounted cumulative gains (NDCG), where the N-th element represents NDCG@N. Search resuls vary in length depending on query, so different rankers cannot be consistently compared using DCG alone unless the DCG is normalized. This is done by calculating the maximum DCG (also known as Ideal DCG), which is the DCG for the ideal ordering of search results sorted by their relative relevance.

$NDCG@N = \frac{DCG@N}{MaxDCG@N}$

Applies to