In this article, by Saleem Ansari , the author of the book Building a Recommendation Engine with Scala , we will discuss content-based recommendation. The main idea in content-based recommendation system is to recommend items to a customer X similar to previous items rated highly by the same customer X. Notice in this definition that we find "similar" items, which means we need to have a measure of similarity between items. To measure similarity of two items, we decode item features and then apply a similarity function. What is a similarity function? A similarity function takes two items (or their feature representations) and returns a value that indicates degree of similarity of two items. Now, there are many different kinds of similarity functions because there are different ways we can represent an item.