Examples of mostSimilarItems()


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()

  }

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

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

  }

  @Test
  public void testMostSimilarToMultipleDontExcludeIfNotSimilarToAll() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<RecommendedItem> similar = recommender.mostSimilarItems(new long[] {1, 2, 4}, 10, false);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(0, 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()

  }

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

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

  }

  @Test
  public void testMostSimilarToMultipleDontExcludeIfNotSimilarToAll() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<RecommendedItem> similar = recommender.mostSimilarItems(new long[] {1, 2, 4}, 10, false);
    assertNotNull(similar);
    assertEquals(2, similar.size());
    RecommendedItem first = similar.get(0);
    RecommendedItem second = similar.get(1);
    assertEquals(0, 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()

  }

  @Test
  public void testMostSimilarToMultipleExcludeIfNotSimilarToAll() throws Exception {
    ItemBasedRecommender recommender = buildRecommender2();
    List<RecommendedItem> similar = recommender.mostSimilarItems(new long[] {3, 4}, 2);
    assertNotNull(similar);
    assertEquals(1, similar.size());
    RecommendedItem first = similar.get(0);
    assertEquals(0, first.getItemID());
    assertEquals(0.2f, first.getValue(), EPSILON);
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.