Making a recommendation engine

Recommendation engines are a powerful way to boost sales on e-commerce websites, since they allow us to suggest to customers products that are likely to meet their preferences.

These suggestions are produced by looking at previous purchases (or wish lists and visited products) and comparing them with other customers and their purchases.

Basically, recommendation engines state that if you bought those products, you are similar to these other customers who also bought these products. So, probably, you will like these products as well.

Getting ready

In this recipe, we will compute the cosine measure of a matrix in order to measure similarity of vectors composing the matrix.

The lsa package provides a specific cosine() function ...

Get RStudio for R Statistical Computing Cookbook 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.