When building recommendation systems or analyzing user behavior, a common question arises: given users interacts with product A, which other products are they most likely to interact with? This seems pretty straightforward, but when digging deeper, we find that naive approaches fail in different ways.
Approach 1: Raw Co-viewing Counts
Lets take a look at an example. In this case, say we are YouTube, and we want to find out which channels a user is most likely to watch if they watch a specific channel.
The simplest approach is to see how many users watch both channels. For each candidate channel X, we can compute the intersection of viewers:
Where is the set of users who watch seed Channel A and is the set who watch target Channel X.
Raw Count: Gaming Channel vs MrBeast
In this example, the affinity score for MrBeast is 40,000. This seems to informative! But if we try to change the seed channel to a different channel, we start to find that the top channels are the same.
Sure 80% of users who watches the gaming channel also watches MrBeast, but 80% of YouTube users already watches MrBeast. This basically tells us nothing more than the viewers are just as likely to watch MrBeast as the average user.
Approach 2: Lift Score
Well then how do we determine if the user behavior is out of the norm or not? We don't just want to know how many viewers of channel A views channel X, we want to see how many viewers of channel A views channel X compared to the general population that views channel X. In this case, we can use the lift score. Lift measures how much more likely users are to watch target Channel X given that they watch seed Channel A, BUT compared to the baseline:
Where is the total number of users. A lift of 1 means no association; higher values indicate positive correlation.
Notice that when ranking different target channels X for a fixed seed channel A, both (total population) and (seed channel size) are constants. This means the lift formula simplifies to:
In other words, lift is just the overlap normalized by the target channel's size.
Lift Score: Gaming Channel vs Similar Creator
The example above shows the lift calculation for the Gaming Channel vs Similar Creator: . Users of the gaming channel are 14.2x more likely to watch this similar creator than the average user. This is a much more informative score.
But there is another issue. When we rank the channels by lift score, we find that the top channels are all obscure channels with very few viewers.
Lift Score: Gaming Channel vs Obscure Reviewer
Approach 3: Log-adjusted Lift
The solution is to weight the lift score by the log of the overlap size. This rewards channels that have both high lift and meaningful sample size:
The natural logarithm compresses large numbers while still rewarding larger overlaps. The +1 prevents undefined behavior when overlap is zero.
Balanced Score: Gaming Channel vs Similar Creator
Here the lift is , and the balanced score is . Compare this to the obscure reviewer with lift of 15: . The similar creator now ranks higher despite having a slightly lower lift, because the log term properly rewards the meaningful sample size.
Try adjusting the values below to see how different channel sizes and overlaps affect the scores:
Interactive Calculator
Lift = (8.5K/50K) / (120K/10M) = 14.17
Log-adjusted = 14.17 × ln(8501) = 128.2
Minimum Overlap Threshold
A quick note: In practice, we often have to apply a minimum overlap threshold (e.g., 100 users) before scoring, which filters out statistically unreliable results. For example, heres what happens if the obscure reviewer only has 5 viewers:
Lift Score: Gaming Channel vs Obscure Reviewer
There is a good chance that maybe 3 of the 5 viewers watch the medium sized gaming channel, but this gives the obscure reviewer a lift score of 666x.
Conclusion
Analyzing user affinity requires balancing competing signals. Raw counts favor popularity. Lift scores favor obscurity. The log-adjusted approach finds the middle ground: channels that are both meaningfully related and have enough data to be confident in the signal.