Book Image

Clojure for Data Science

By : Henry Garner
Book Image

Clojure for Data Science

By: Henry Garner

Overview of this book

Table of Contents (18 chapters)
Clojure for Data Science
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

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 the MovieLens data in the org.apache...