poprox_recommender.evaluation.metrics#

Functions

convert_df_to_article_set(rec_df)

measure_user_recs(user)

Measure a single user's recommendations.

Classes

UserRecs(user_id, personalized, recs, truth)

A user's recommendations (possibly from multiple algorithms and stages)

poprox_recommender.evaluation.metrics.rank_biased_overlap(recs_list_a, recs_list_b, p=0.9, k=10)#

Computes the RBO metric defined in: Webber, William, Alistair Moffat, and Justin Zobel. “A similarity measure for indefinite rankings.” ACM Transactions on Information Systems (TOIS) 28.4 (2010): 20.

https://dl.acm.org/doi/10.1145/1852102.1852106

Parameters:
Return type:

float

class poprox_recommender.evaluation.metrics.UserRecs(user_id, personalized, recs, truth)#

Bases: NamedTuple

A user’s recommendations (possibly from multiple algorithms and stages)

Parameters:
user_id: UUID#

Alias for field number 0

personalized: bool#

Alias for field number 1

recs: DataFrame#

Alias for field number 2

truth: DataFrame#

Alias for field number 3

poprox_recommender.evaluation.metrics.measure_user_recs(user)#

Measure a single user’s recommendations. Returns the user ID and a data frame of evaluation metrics.

Parameters:

user (UserRecs)

Return type:

tuple[UUID, DataFrame]

Modules

rbo