Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

Chengbin HOU houchengbin

🐢
  • Birmingham; Shenzhen
View GitHub Profile
@houchengbin
houchengbin / letor_metrics.py
Created Dec 20, 2020 — forked from mblondel/letor_metrics.py
Learning to rank metrics.
View letor_metrics.py
# (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