The Jokes recommendation system we built earlier, with item-based filtering, uses the powerful recommenderlab library available in R. In this implementation of the user-based collaborative filtering (UBCF) approach, we make use of the same library.
The following diagram shows the working principle of UBCF:
![](https://static.packt-cdn.com/products/9781789807943/graphics/assets/d22941f0-29d2-4c0e-8a79-5f065e5f527e.png)
Example depicting working principle of user based collaborative filter
To understand the concept better, let's discuss the preceding diagram in detail. Let's assume that there are three users: X,Y, and Z. In UBCF, users X and Z are very similar as both of them like strawberries and watermelons. User X also likes grapes and oranges. So a user-based collaborative filter recommends grapes and oranges to user Z. The idea is that similar people tend to like similar things.
The primary...