Skip to content

Instantly share code, notes, and snippets.

View houchengbin's full-sized avatar
:octocat:

Chengbin HOU houchengbin

:octocat:
View GitHub Profile
@mblondel
mblondel / letor_metrics.py
Last active January 14, 2024 16:27
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