calc_novelty_metrics

rectools.metrics.novelty.calc_novelty_metrics(metrics: Dict[str, MeanInvUserFreq], reco: DataFrame, prev_interactions: DataFrame) Dict[str, float][source]

Calculate novelty metrics (only MeanInvUserFreq now).

Warning: It is not recommended to use this function directly. Use calc_metrics instead.

Parameters
  • metrics (dict(str -> NoveltyMetric)) – Dict of metric objects to calculate, where key is metric name and value is metric object.

  • reco (pd.DataFrame) – Recommendations table with columns Columns.User, Columns.Item, Columns.Rank.

  • prev_interactions (pd.DataFrame) – Table with previous user-item interactions, with columns Columns.User, Columns.Item.

Returns

Dictionary where keys are the same as keys in metrics and values are metric calculation results.

Return type

dict(str->float)