Package org.apache.mahout.cf.taste.impl.recommender.svd

Examples of org.apache.mahout.cf.taste.impl.recommender.svd.SVDRecommender.recommend()


        // Corn:
        // (2*(-0.24019223070763077)+2*(0.8196561646738477)) / (-0.24019223070763077+0.8196561646738477) = 2
        System.out.println("UserBased: Wolf should eat: "+id2thing.toStringID(r.getItemID())+" Rating: "+r.getValue());
      }
      SVDRecommender svdrecommender = new SVDRecommender(model, new SVDPlusPlusFactorizer(model, 4, 1000));
      for(RecommendedItem r : svdrecommender.recommend(id2thing.toLongID("Sheep"), 3)) {
        System.out.println("SVD: Sheep should eat: "+id2thing.toStringID(r.getItemID())+" Rating: "+r.getValue());
      }
    } catch (TasteException e) {
      e.printStackTrace();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.