sklearn.metrics.dcg_score

sklearn.metrics.dcg_score(y_true, y_score, k=5)[source]

Discounted cumulative gain (DCG) at rank K.

Parameters:

y_true : array, shape = [n_samples]

Ground truth (true relevance labels).

y_score : array, shape = [n_samples]

Predicted scores.

k : int

Rank.

Returns:

score : float

References

[R501501]Wikipedia entry for the Discounted Cumulative Gain