Building a user-based recommender with Mahout
The Mahout library comes with a lot of built-in classes, which are designed to work together to assist in building custom recommendation engines. Mahout's functionality to construct recommenders is in the org.apache.mahout.cf.taste
namespace.
Note
Mahout's recommendation engine capabilities come from the Taste open source project with which it merged in 2008.
In the previous chapter, we discovered how to make use of Mahout to cluster with Clojure's Java interop capabilities. In this chapter, we'll make use of Mahout's recommenders with GenericUserBasedRecommender
available in the org.apache.mahout.cf.taste.impl.recommender
package.
As with many user-based recommenders, we also need to define a similarity metric to quantify how alike two users are. We'll also define a user neighborhood as each user's set of 10 most similar users.
First, we must load the data. Mahout includes a utility class, FileDataModel
, to load...