Examples of mostSimilarItems()


Examples of net.myrrix.common.MyrrixRecommender.mostSimilarItems()

    RescorerProvider rescorerProvider = getRescorerProvider();
    try {
      int howMany = getHowMany(request);
      Iterable<RecommendedItem> similar;
      if (rescorerProvider == null) {
        similar = recommender.mostSimilarItems(itemIDSet.toArray(), howMany);
      } else {
        Rescorer<LongPair> rescorer =
            rescorerProvider.getMostSimilarItemsRescorer(recommender, getRescorerParams(request));
        similar = recommender.mostSimilarItems(itemIDSet.toArray(),
                                               howMany,
View Full Code Here

Examples of net.myrrix.common.MyrrixRecommender.mostSimilarItems()

      if (rescorerProvider == null) {
        similar = recommender.mostSimilarItems(itemIDSet.toArray(), howMany);
      } else {
        Rescorer<LongPair> rescorer =
            rescorerProvider.getMostSimilarItemsRescorer(recommender, getRescorerParams(request));
        similar = recommender.mostSimilarItems(itemIDSet.toArray(),
                                               howMany,
                                               rescorer);
      }
      output(request, response, similar);
    } catch (NoSuchItemException nsie) {
View Full Code Here

Examples of net.myrrix.online.ServerRecommender.mostSimilarItems()

      public void process(Long itemID, long count) throws ExecutionException {
        Rescorer<LongPair> rescorer =
            rescorerProvider == null ? null : rescorerProvider.getMostSimilarItemsRescorer(recommender);
        Iterable<RecommendedItem> similar;
        try {
          similar = recommender.mostSimilarItems(new long[]{itemID}, howMany, rescorer);
        } catch (TasteException te) {
          throw new ExecutionException(te);
        }
        String outLine = formatOutLine(itemID, similar);
        synchronized (out) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

    assertEquals(0.18, firstRecommended.getValue(), EPSILON);
  }

  public void testMostSimilar() throws Exception {
    ItemBasedRecommender recommender = buildRecommender();
    List<RecommendedItem> similar = recommender.mostSimilarItems(0, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(1, first.getItemID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

    assertEquals(0.5, second.getValue(), EPSILON);
  }

  public void testMostSimilarToMultiple() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<RecommendedItem> similar = recommender.mostSimilarItems(new long[] {0, 1}, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(2, first.getItemID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

  }

  @Test
  public void testMostSimilar() throws Exception {
    ItemBasedRecommender recommender = buildRecommender();
    List<RecommendedItem> similar = recommender.mostSimilarItems(0, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(1, first.getItemID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

  }

  @Test
  public void testMostSimilarToMultiple() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<RecommendedItem> similar = recommender.mostSimilarItems(new long[] {0, 1}, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(2, first.getItemID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

    assertEquals(0.1, firstRecommended.getValue(), EPSILON);
  }

  public void testMostSimilar() throws Exception {
    ItemBasedRecommender recommender = buildRecommender();
    List<RecommendedItem> similar = recommender.mostSimilarItems("0", 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals("1", first.getItem().getID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

  public void testMostSimilarToMultiple() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<Object> itemIDs = new ArrayList<Object>(2);
    itemIDs.add("0");
    itemIDs.add("1");
    List<RecommendedItem> similar = recommender.mostSimilarItems(itemIDs, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals("2", first.getItem().getID());
View Full Code Here

Examples of org.apache.mahout.cf.taste.recommender.ItemBasedRecommender.mostSimilarItems()

  }

  @Test
  public void testMostSimilar() throws Exception {
    ItemBasedRecommender recommender = buildRecommender();
    List<RecommendedItem> similar = recommender.mostSimilarItems(0, 2);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(1, first.getItemID());
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.