{"version":"1.0","type":"rich","title":"Ranking Metrics","description":"This example implements a collection of information retrieval ranking metrics in Python. It defines functions for mean reciprocal rank, R-precision, precision at k, average precision, mean average precision, and discounted cumulative gain, each accepting relevance scores in rank order. The code uses NumPy arrays to compute binary relevance and graded relevance calculations, with doctests illustrating expected outputs. The implementation follows standard definitions from academic resources on IR evaluation, such as precision-recall curves and learning-to-rank literature.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-bdb3f614ee73be1a422a1e4e71a04e72?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}