O'Reilly logo

Learning Haskell Data Analysis by James Church

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a recommendation engine

When we left the recommendation engine problem at the beginning of the chapter, we created the wordsMatrix variable. We should now have enough background with regards to the benefits of the eigenvalue decomposition process, which will help us to finish the creation of our recommendation engine. We can use the principalComponentAnalysis function and produce our own dataset based on wordsMatrix, as follows:

> let pcaMatrix = principalComponentAnalysis wordsMatrix 5

The pcaMatrix function is a compressed form of the wordsMatrix variable, which focuses on the 5 vectors with the highest variance.

Finding the nearest neighbors

Each row in the pcaMatrix function represents one user. If we were to plot this dataset (which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required