Blend personal and popular scores for cold-start users
Why it matters Shrinkage toward popularity is a standard fix for cold-start users in feeds, shops and streaming apps.
A user with two interactions has a noisy personal profile. Recommenders shrink such users toward the global popularity scores, trusting the personal model more as history grows.
Write blend_scores(personal, popular, n, shrink, k). personal and popular are length I score lists (personal may be None for a brand-new user). The trust weight is w = n / (n + shrink), or 0 if personal is None. Score = w * personal + (1 - w) * popular. Return (scores as a numpy array, list of the top k item indices by score with ties to the smaller index).
def blend_scores(personal, popular, n, shrink, k)Example
blend_scores([1, 0, 0], [0, 1, 0.5], 1, 3, 2) gives (array([0.25, 0.75, 0.375]), [1, 2]).
Understand the idea
A new user's personal model is built on very little data, so it is mostly noise. Popular items are a safe guess for anyone. The fix is to blend the two, and to move the blend toward personal scores as evidence piles up, the same way you would trust a friend's restaurant advice more after they have eaten out a lot.
Example: shrink 3, user with n = 1 interaction. w = 1 / (1 + 3) = 0.25. An item the personal model loves (1.0) but nobody else watches (0) gets 0.25. A popular item (1.0) the personal model ignores gets 0.75. With n = 97, w = 0.97 and the personal model takes over.
Rule: w = n / (n + shrink); score = w * personal + (1 - w) * popular.
The shrink constant is tuned offline; it equals the number of interactions at which both sources get equal weight.