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:
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...