Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View houchengbin's full-sized avatar
:octocat:

Chengbin HOU houchengbin

:octocat:
View GitHub Profile
@houchengbin
houchengbin / letor_metrics.py
Created December 20, 2020 15:08 — 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