Chapter 12. Taking the best of all algorithms: Implementing hybrid recommenders

 

This chapter is a hybrid of many sections:

  • You’ll learn to combine recommenders to take advantage of the strengths and weaknesses of different types of recommender systems.
  • You’ll tour the overall classes of hybrid recommenders.
  • You’ll be introduced to ensemble recommenders.
  • Having knowledge of ensemble recommenders, you’ll look at how to implement a specific algorithm called feature-weighted linear stacking (FWLS).

Supposedly one of the most energy-efficient cars ever made is a hybrid: a Toyota Prius. At its core, Toyota combines two well-known technologies—the combustion engine and the electric engine.[1] Hybrid recommenders are basically the same idea—you combine recommender algorithms to get a more powerful tool. These not only improve the average result, but also attempt to mitigate the corner cases, where algorithms don’t work well.

1 For more information, see https://en.wikipedia.org/wiki/Toyota_Prius.

Figure 12.1 shows the four most acknowledged classes of recommender systems and their data sources. We’ve talked about each recommender system as something that runs alone and in a silo, but the world is far from being this ordered. To provide recommendations, you need to do a mix, or a hybrid, of more than one system. Also, if you’ve access to more than one of the data sources shown in the figure, it’s a sin not to use all of them!

12.1. The confused world of hybrids

12.2. The monolithic

12.2.1. Mixing content-based features with behavioral data to improve col- llaborative filtering recommenders

12.3. Mixed hybrid recommender

12.4. The ensemble

12.4.1. Switched ensemble recommender

12.4.2. Weighted ensemble recommender

12.4.3. Linear regression

12.5. Feature-weighted linear stacking (FWLS)

12.5.1. Meta features: Weights as functions

12.5.2. The algorithm

12.6. Implementation

Loading the data