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

Examples of org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender$MostSimilarEstimator


  @Test
  public void testFile() throws Exception {
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(3, userSimilarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
    assertEquals(1, recommender.recommend(123, 3).size());
    assertEquals(0, recommender.recommend(234, 3).size());
    assertEquals(1, recommender.recommend(345, 3).size());

    // Make sure this doesn't throw an exception
    model.refresh(null);
  }
View Full Code Here


  private final Recommender recommender;

  public BookCrossingRecommender(DataModel dataModel, BookCrossingDataModel bcModel) throws TasteException {
    UserSimilarity similarity = new GeoUserSimilarity(bcModel);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(5, similarity, dataModel);
    recommender = new CachingRecommender(new GenericUserBasedRecommender(dataModel, neighborhood, similarity));
  }
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 void testFile() throws Exception {
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(2, userSimilarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
    assertEquals(2, recommender.recommend("A123", 3).size());
    assertEquals(2, recommender.recommend("B234", 3).size());
    assertEquals(1, recommender.recommend("C345", 3).size());

    // Make sure this doesn't throw an exception
    model.refresh(null);
  }
View Full Code Here

  @Test
  public void testFile() throws Exception {
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(3, userSimilarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
    assertEquals(1, recommender.recommend(123, 3).size());
    assertEquals(0, recommender.recommend(234, 3).size());
    assertEquals(1, recommender.recommend(345, 3).size());

    // Make sure this doesn't throw an exception
    model.refresh(null);
  }
View Full Code Here

  private final Recommender recommender;

  public BookCrossingRecommender(DataModel bcModel) throws TasteException {
    UserSimilarity similarity = new CachingUserSimilarity(new EuclideanDistanceSimilarity(bcModel), bcModel);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, 0.2, similarity, bcModel, 0.2);
    recommender = new GenericUserBasedRecommender(bcModel, neighborhood, similarity);
  }
View Full Code Here

    }

    System.out.println("Run Users");
    UserSimilarity userSim = new EuclideanDistanceSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, userSim, model);
    recommender = new GenericUserBasedRecommender(model, neighborhood, userSim);
    for (int i = 0; i < LOOPS; i++) {
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
    }
View Full Code Here

  }

  public void testFile() throws Exception {
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(2, userSimilarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
    assertEquals(2, recommender.recommend(123, 3).size());
    assertEquals(2, recommender.recommend(234, 3).size());
    assertEquals(1, recommender.recommend(345, 3).size());

    // Make sure this doesn't throw an exception
    model.refresh(null);
  }
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

  @Test
  public void testFile() throws Exception {
    UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood = new NearestNUserNeighborhood(3, userSimilarity, model);
    Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);
    assertEquals(1, recommender.recommend(123, 3).size());
    assertEquals(0, recommender.recommend(234, 3).size());
    assertEquals(1, recommender.recommend(345, 3).size());

    // Make sure this doesn't throw an exception
    model.refresh(null);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender$MostSimilarEstimator

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.