Predicting the rating for the product

Let's now take this framework and use it to predict the rating for a product. We'll limit our example to three users, person X, person Y, and person Z. We'll predict the rating of a product that person X hasn't rated, but that persons Y and Z, who are very similar to X, have rated.

We'll start with our base ratings for each user, as shown in the following table:

Customers

Snarky's Potato Chips

SoSo Smooth Lotion

Duffly Beer

BetterTap Water

XXLargeLivin' Football Jersey

Snowy Cotton Balls

Disposos' Diapers

X

4

3

4

Y

3.5

2.5

4

4

Z

4

3.5

4.5

4.5

Next, we'll center the ratings:

Customers

Snarky's Potato Chips

SoSo Smooth Lotion

Get Python Machine Learning Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.