outer_merge_reco
- rectools.metrics.base.outer_merge_reco(reco: DataFrame, interactions: DataFrame) DataFrame[source]
Merge recommendation table with interactions table with outer join. All ranks for all users are present with no skipping. Null ranks will be specified for test interactions that were not predicted in recommendations. This method is useful for AUC based ranking metrics.
- Parameters
reco (pd.DataFrame) – Recommendations table with columns Columns.User, Columns.Item, Columns.Rank.
interactions (pd.DataFrame) – Interactions table with columns Columns.User, Columns.Item.
- Returns
Result of merging with added __test_positive boolean column.
- Return type
pd.DataFrame