O'Reilly logo

Apache Mahout Essentials by Jayani Withanawasam

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

Singular value decomposition

Using Singular Value Decomposition (SVD), we can come up with a more generalized set of features to represent the user-item preferences for a large dataset using dimensionality reduction techniques. This approach helps to generalize users into lesser dimensions.

The following is the Java code example for SVD using ALS-WR as the factorizer; the number of target features should be given as input, which in this case (3. 0.065) is given as lambda (the regularization parameter), and the number of iterations is given as 1:

DataModel svdmodel = new FileDataModel (new File("movie.csv")); ALSWRFactorizer factorizer = new ALSWRFactorizer(svdmodel, 3, 0.065, 1); Recommender svdrecommender = new SVDRecommender(svdmodel, factorizer); ...

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