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's a simple setup that prepares us to focus on novelty:
This setup includes an object, itemPopularity, representing how often each item appears among users, an array of predictedItems that our system has recommended, and a totalUsers 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 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/popularity.
- Normalization: Dividing the sum by the number of predicted items gives us an average novelty score.
Mathematical Formula for Novelty
Before coding, let’s formalize novelty.
- R: the list of recommended items, with length k = |R|
- p(i): the probability (popularity) of item i, typically estimated as popularity(i) / totalUsers
- b: the logarithm base; use b = e (natural log) by default; b = 2 yields bits
Formula:
Interpretation:
- -log p(i) is the surprisal (self-information) of item i; rarer items (smaller p(i)) contribute more.
- Averaging by |R| normalizes for list length.
Worked example with the lesson’s data:
- R = [1, 5, 3], k = 3
- p(1) = 80/100 = 0.80, p(5) = 5/100 = 0.05, p(3) = 30/100 = 0.30
- Using natural log (b = e):
- -ln(0.80) = 0.2231
- -ln(0.05) = 2.9957
- -ln(0.30) = 1.2040
- Novelty = (0.2231 + 2.9957 + 1.2040) / 3 = 1.4743 nats ≈ 1.47
Bounds at a glance:
- Because 0 < p(i) ≤ 1, each -log_b p(i) ≥ 0, so 0 ≤ Novelty(R) ≤ -log_b(p_min), where p_min is the smallest probability you allow (after smoothing).
- With counts/totalUsers and minimum count c_min ≥ 1, p_min = c_min / totalUsers (e.g., in this lesson p_min = 0.05 ⇒ upper bound ≈ 2.996 nats for b = e).
- Optional normalization for comparability: Novelty_norm = Novelty / -log_b(p_min) ∈ [0, 1].
