Understanding Novelty Metrics
Introduction to Novelty in Recommendation Systems
In this lesson, we will explore the concept of novelty in recommendation systems, a key aspect that complements your understanding of metrics like coverage, discussed in the previous lesson. Novelty measures how unexpected or unique the recommended items are to users. A high novelty score indicates that your recommendation system is providing items that users are less likely to have encountered before, potentially leading to increased engagement and user satisfaction. Balancing novelty with relevance is crucial, as overly novel recommendations may not align with user interests.
Setup
Let's briefly discuss the setup we will use as an example for this lesson. Here is a simple setup using C++ data structures:
In this setup, item_popularity is a std::map that represents how often each item appears among users. The predicted_items vector contains the items that our system has recommended, and total_users holds the total number of users.
Understanding Novelty Calculation
Novelty quantifies the freshness or unexpectedness of recommendations. We calculate it using the popularity data of the items. Here is how it works conceptually:
- Item Popularity: The frequency with which an item is recommended or interacted with by users. We treat this popularity as the probability of recommending an item to a user.
- Logarithmic Probability: We use logarithms to assign higher novelty scores to items with lower probability or popularity.
- Normalization: Dividing the sum by the number of predicted items gives us an average novelty score.
Detailed Walkthrough of the Novelty Score Code
Let's break down the code used to calculate the novelty score step by step in C++.
Output:
Explanation:
-
Include Libraries: We include the necessary
C++standard libraries for input/output, data structures, and mathematical operations. -
Function Definition: The
noveltyfunction takespredicted_items,item_popularity, andtotal_usersas inputs. -
Logarithmic Probability Calculation: We iterate through each item in
predicted_items. If the item exists initem_popularity, we calculate its probability and then compute the negative logarithm. Thecountmethod checks if the item exists in the map. -
Summation and Averaging: We sum the negative logarithms for all items in
predicted_itemsand divide by the number of predicted items to compute the average, returning this value as the novelty score.
The obtained score indicates a moderate level of novelty across the predicted items.
