You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Saurav Sarkar <sa...@gmail.com> on 2016/10/03 07:45:31 UTC

SVD Recommender using Mahout

Hi All,

I am new to Mahout and I am trying to  run SVDRecommender on movie lens
dataset.

The program is getting stuck when i am initializing the
SVDPlusPlusFactorizer.
Ratings.csv contains data in the form of userid,itemid,ratings.
Is it the right way to do ?

Below is my code.

    public void recommendSVDRecommender(){
try{
FileDataModel model = new FileDataModel(new
File("\\data\\movielens\\ratings.csv"));
SVDPlusPlusFactorizer factorizer = new SVDPlusPlusFactorizer(model,4,20);
SVDRecommender recommender = new SVDRecommender(model, factorizer);
List<RecommendedItem> recommendations = recommender.recommend(2, 5);
for (RecommendedItem recommendation : recommendations) {
 System.out.println(recommendation);
}
}
catch(Exception e){
e.printStackTrace();
}
}

cheers,

Saurav