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