Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / letor_metrics.py
Created June 15, 2017 06:31 — forked from mblondel/letor_metrics.py
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters