195
Building a recommendations system
EXERCISES
10.1
In the Netflix example, you calculated the distance between two
different users using the distance formula. But not all users rate
movies the same way.
Suppose you have two users, Yogi and Pinky,
who have the same taste in movies. But Yogi rates any movie he
likes as a 5, whereas Pinky is choosier and reserves the 5s for
only the best. They’re well matched, but
according to the distance
algorithm, they aren’t neighbors. How would you take their
different rating strategies into account?
10.2
Suppose Netflix nominates a group of “influencers.” For example,
Quentin Tarantino and Wes Anderson are influencers on Netflix,
so their ratings count for more than a normal user’s. How would
you change the recommendations system so it’s biased toward the
ratings of influencers?
Regression
Suppose you want to do more than just recommend a movie: you want
to guess how Priyanka will rate this movie. Take
the five people closest
to her.
By the way, I keep talking about the closest five people. There’s nothing
special about the number 5: you could do the closest 2, or 10, or 10,000.
That’s why the algorithm is called k-nearest neighbors and not five-
nearest neighbors!
Suppose you’re trying to guess a rating for
Pitch Perfect
. Well, how did
Justin, JC, Joey, Lance, and Chris rate it?