Skip to content

Commit

Permalink
more metric citations
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Feb 12, 2022
1 parent 7b12ec3 commit d88b41b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
11 changes: 11 additions & 0 deletions docs/lenskit.bib
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ @ARTICLE{movielens
doi = "10.1145/2827872"
}

@INPROCEEDINGS{Kantor1997-lm,
title = "Report on the {TREC-5} Confusion Track",
booktitle = "The Fifth Text {REtrieval} Conference ({TREC-5})",
author = "Kantor, Paul B and Voorhees, Ellen",
institution = "NIST",
month = oct,
year = 1997,
url = "http://trec.nist.gov/pubs/trec5/t5_proceedings.html",
location = "Gaithersburg, Maryland"
}

@INPROCEEDINGS{Hu2008-li,
title = "Collaborative Filtering for Implicit Feedback Datasets",
booktitle = "2008 Eighth {IEEE} International Conference on Data Mining",
Expand Down
16 changes: 9 additions & 7 deletions lenskit/metrics/topn.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ def _bulk_recall(recs, truth, k=None):

def recip_rank(recs, truth, k=None):
"""
Compute the reciprocal rank of the first relevant item in a list of recommendations.
Let :math:`\\kappa` denote the 1-based rank of the first relevant item in :math:`L`,
with :math:`\\kappa=\\infty` if none of the first :math:`k` items in :math:`L` are relevant;
then the reciprocal rank is :math:`1 / \\kappa`. If no elements are relevant, the reciprocal
rank is therefore 0.
Compute the reciprocal rank :cite:p:`Kantor1997-lm` of the first relevant
item in a list of recommendations. Let :math:`\\kappa` denote the 1-based
rank of the first relevant item in :math:`L`, with :math:`\\kappa=\\infty`
if none of the first :math:`k` items in :math:`L` are relevant; then the
reciprocal rank is :math:`1 / \\kappa`. If no elements are relevant, the
reciprocal rank is therefore 0. :cite:t:`Deshpande2004-ht` call this the
“reciprocal hit rate”.
This metric has a bulk equivalent.
"""
Expand Down Expand Up @@ -178,7 +180,7 @@ def _fixed_dcg(n, discount=np.log2):

def dcg(recs, truth, discount=np.log2):
"""
Compute the **unnormalized** discounted cumulative gain.
Compute the **unnormalized** discounted cumulative gain :cite:p:`Jarvelin2002-xf`.
Discounted cumultative gain is computed as:
Expand Down Expand Up @@ -213,7 +215,7 @@ def dcg(recs, truth, discount=np.log2):

def ndcg(recs, truth, discount=np.log2, k=None):
"""
Compute the normalized discounted cumulative gain.
Compute the normalized discounted cumulative gain :cite:p:`Jarvelin2002-xf`.
Discounted cumultative gain is computed as:
Expand Down

0 comments on commit d88b41b

Please sign in to comment.