calc_catalog_metrics

rectools.metrics.catalog.calc_catalog_metrics(metrics: Dict[str, CatalogCoverage], reco: DataFrame, catalog: Collection[Union[str, int]]) Dict[str, float][source]

Calculate metrics of catalog statistics for recommendations.

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

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

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

  • catalog (collection) – Collection of unique item ids that could be used for recommendations.

Returns

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

Return type

dict(str->float)