Novelty in Recommendation Systems
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's a simple setup that prepares us to focus on novelty:
This setup includes a dictionary item_popularity representing how often each item appears among users, a list of predicted_items that our system has recommended, and a total_users count.
Understanding Novelty Calculation
Novelty quantifies the freshness or unexpectedness of recommendations. We calculate it using the popularity data of the items. Here's how it works conceptually:
- Item Popularity: The frequency with which an item is recommended or interacted with by users. It is important that we can treat this popularity as probability of recommending an item to a user.
- Logarithmic Probability: We use logarithms to assign higher novelty scores to items with lower probability/popularity.
- Normalization: Dividing the sum by the number of predicted items gives us an average novelty score.
Detailed Walkthrough of the Novelty Score Code
We'll now break down the code used to calculate the novelty score step-by-step.
- Import Libraries: We start by importing the
mathlibrary for logarithmic calculations. - Function Definition: The
noveltyfunction takespredicted_items,item_popularity, andtotal_usersas inputs. - Logarithmic Probability Calculation: Using a generator expression, we calculate the logarithm of the inverse probability of each predicted item. The
getmethod with a default value of 0 ensures we handle items not initem_popularity. - Summation and Averaging: We sum the negative logarithms for all items in
predicted_itemsand divide by the length ofpredicted_itemsto compute the average, returning this value as the novelty score.
The obtained score indicates a moderate level of novelty across the predicted items.
