This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Compute ndcg @ k | |
| def ndcg_at_k(predictions_df, k): | |
| """ | |
| This pandas dataframe should contain the columns "customer_id", | |
| "estimate", and "label". | |
| Where `estimate` is a recommendation score | |
| that we can sort by descending order. | |
NewerOlder