Package org.apache.mahout.cf.taste.impl.similarity.precompute

Examples of org.apache.mahout.cf.taste.impl.similarity.precompute.MultithreadedBatchItemSimilarities


    }

    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


    }

    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.impl.similarity.precompute.MultithreadedBatchItemSimilarities

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.