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

Examples of org.apache.mahout.cf.taste.impl.recommender.CachingRecommender


  }

  public void testItemLoad() throws Exception {
    DataModel model = createModel();
    ItemSimilarity itemSimilarity = new PearsonCorrelationSimilarity(model);
    Recommender recommender = new CachingRecommender(new GenericItemBasedRecommender(model, itemSimilarity));
    doTestLoad(recommender, 240);
  }
View Full Code Here


  public void testUserLoad() throws Exception {
    DataModel model = createModel();
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, userSimilarity, model);
    Recommender recommender =
            new CachingRecommender(new GenericUserBasedRecommender(model, neighborhood, userSimilarity));
    doTestLoad(recommender, 40);
  }
View Full Code Here

public final class JesterRecommender implements Recommender {
 
  private final Recommender recommender;
 
  public JesterRecommender(DataModel dataModel) throws TasteException {
    recommender = new CachingRecommender(new SlopeOneRecommender(dataModel));
  }
View Full Code Here

   *
   * @param dataModel data model
   * @throws TasteException if an error occurs while initializing this
   */
  public GroupLensRecommender(DataModel dataModel) throws TasteException {
    recommender = new CachingRecommender(new SlopeOneRecommender(dataModel));
  }
View Full Code Here

   *
   * @param dataModel data model
   * @throws TasteException if an error occurs while initializing this {@link GroupLensRecommender}
   */
  public GroupLensRecommender(DataModel dataModel) throws TasteException {
    recommender = new CachingRecommender(new SlopeOneRecommender(dataModel));
  }
View Full Code Here

  private final Recommender recommender;

  public BookCrossingRecommender(DataModel bcModel) throws TasteException {
    UserSimilarity similarity = new PearsonCorrelationSimilarity(bcModel);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, 0.0, similarity, bcModel, 0.1);
    recommender = new CachingRecommender(new GenericUserBasedRecommender(bcModel, neighborhood, similarity));
  }
View Full Code Here

public final class JesterRecommender implements Recommender {

  private final Recommender recommender;

  public JesterRecommender(DataModel dataModel) throws TasteException {
    recommender = new CachingRecommender(new SlopeOneRecommender(dataModel));
  }
View Full Code Here

            100, similarity, model);

    Recommender recommender =  new GenericUserBasedRecommender(
        model, neighborhood, similarity);

    Recommender cachingRecommender = new CachingRecommender(recommender);

    for(int userId: userIds) {
      System.out.println("UserID " + userId);
      List<RecommendedItem> recommendations =
          cachingRecommender.recommend(userId, 2);
      for(RecommendedItem item: recommendations) {
        System.out.println("  item " + item.getItemID() + " score " + item.getValue());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.recommender.CachingRecommender

Copyright © 2018 www.massapicom. 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.