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

Examples of org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender$RecommendedBecauseEstimator


  }

  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


      howMany = Integer.parseInt(args[1]);
    }

    System.out.println("Run Items");
    ItemSimilarity similarity = new EuclideanDistanceSimilarity(model);
    Recommender recommender = new GenericItemBasedRecommender(model, similarity); // Use an item-item recommender
    for (int i = 0; i < LOOPS; i++){
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
    }
View Full Code Here

  }

  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

  private final Recommender recommender;

  public Track1Recommender(DataModel dataModel) throws TasteException {
    // Change this to whatever you like!
    ItemSimilarity similarity = new UncenteredCosineSimilarity(dataModel);
    recommender = new GenericItemBasedRecommender(dataModel, similarity);
  }
View Full Code Here

      howMany = Integer.parseInt(args[1]);
    }

    System.out.println("Run Items");
    ItemSimilarity similarity = new EuclideanDistanceSimilarity(model);
    Recommender recommender = new GenericItemBasedRecommender(model, similarity); // Use an item-item recommender
    for (int i = 0; i < LOOPS; i++) {
      LoadStatistics loadStats = LoadEvaluator.runLoad(recommender, howMany);
      System.out.println(loadStats);
    }
View Full Code Here

    if (resultFile.exists()) {
      resultFile.delete();
    }

    DataModel dataModel = new GroupLensDataModel(new File(args[0]));
    ItemBasedRecommender recommender = new GenericItemBasedRecommender(dataModel,
        new LogLikelihoodSimilarity(dataModel));
    BatchItemSimilarities batch = new MultithreadedBatchItemSimilarities(recommender, 5);

    int numSimilarities = batch.computeItemSimilarities(Runtime.getRuntime().availableProcessors(), 1,
        new FileSimilarItemsWriter(resultFile));
View Full Code Here

    if (resultFile.exists()) {
      resultFile.delete();
    }

    DataModel dataModel = new GroupLensDataModel(new File(args[0]));
    ItemBasedRecommender recommender = new GenericItemBasedRecommender(dataModel,
        new LogLikelihoodSimilarity(dataModel));
    BatchItemSimilarities batch = new MultithreadedBatchItemSimilarities(recommender, 5);

    int numSimilarities = batch.computeItemSimilarities(Runtime.getRuntime().availableProcessors(), 1,
        new FileSimilarItemsWriter(resultFile));
View Full Code Here

    userData.put(2, new GenericUserPreferenceArray(Arrays.asList(new GenericPreference(2, 1, 1),
        new GenericPreference(2, 2, 1), new GenericPreference(2, 4, 1))));

    DataModel dataModel = new GenericDataModel(userData);
    ItemBasedRecommender recommender =
        new GenericItemBasedRecommender(dataModel, new TanimotoCoefficientSimilarity(dataModel));

    BatchItemSimilarities batchSimilarities = new MultithreadedBatchItemSimilarities(recommender, 10);

    batchSimilarities.computeItemSimilarities(1, 1, mock(SimilarItemsWriter.class));
  }
View Full Code Here

    userData.put(2, new GenericUserPreferenceArray(Arrays.asList(new GenericPreference(2, 1, 1),
        new GenericPreference(2, 2, 1), new GenericPreference(2, 4, 1))));

    DataModel dataModel = new GenericDataModel(userData);
    ItemBasedRecommender recommender =
        new GenericItemBasedRecommender(dataModel, new TanimotoCoefficientSimilarity(dataModel));

    BatchItemSimilarities batchSimilarities = new MultithreadedBatchItemSimilarities(recommender, 10);

    try {
      // Batch size is 100, so we only get 1 batch from 3 items, but we use a degreeOfParallelism of 2
View Full Code Here

  private final Recommender recommender;

  public Track1Recommender(DataModel dataModel) throws TasteException {
    // Change this to whatever you like!
    ItemSimilarity similarity = new UncenteredCosineSimilarity(dataModel);
    recommender = new GenericItemBasedRecommender(dataModel, similarity);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender$RecommendedBecauseEstimator

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.