Package org.apache.mahout.cf.taste.example.grouplens

Examples of org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel


  private GroupLens10MEvalIntro() {
  }

  public static void main(String[] args) throws Exception {
    DataModel model = new GroupLensDataModel(new File("ratings.dat"));

    RecommenderEvaluator evaluator =
      new AverageAbsoluteDifferenceRecommenderEvaluator();
    RecommenderBuilder recommenderBuilder = new RecommenderBuilder() {
      @Override
View Full Code Here


  private GroupLensDataModelIntro() {
  }

  public static void main(String[] args) throws Exception {
    DataModel model = new GroupLensDataModel(new File("ratings.dat"));
    UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
    UserNeighborhood neighborhood =
      new NearestNUserNeighborhood(100, similarity, model);
    Recommender recommender =
      new GenericUserBasedRecommender(model, neighborhood, similarity);
View Full Code Here

    File resultFile = new File(System.getProperty("java.io.tmpdir"), "similarities.csv");
    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));

    System.out.println("Computed " + numSimilarities + " similarities for " + dataModel.getNumItems() + " items "
        + "and saved them to " + resultFile.getAbsolutePath());
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.example.grouplens.GroupLensDataModel

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.