org.apache.mahout.cf.taste.similarity.precompute
Class BatchItemSimilarities
java.lang.Object
org.apache.mahout.cf.taste.similarity.precompute.BatchItemSimilarities
- Direct Known Subclasses:
- MultithreadedBatchItemSimilarities
public abstract class BatchItemSimilarities
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BatchItemSimilarities
protected BatchItemSimilarities(ItemBasedRecommender recommender,
int similarItemsPerItem)
- Parameters:
recommender - recommender to usesimilarItemsPerItem - number of similar items to compute per item
getRecommender
protected ItemBasedRecommender getRecommender()
getSimilarItemsPerItem
protected int getSimilarItemsPerItem()
computeItemSimilarities
public abstract int computeItemSimilarities(int degreeOfParallelism,
int maxDurationInHours,
SimilarItemsWriter writer)
throws IOException
- Parameters:
degreeOfParallelism - number of threads to use for the computationmaxDurationInHours - maximum duration of the computationwriter - SimilarItemsWriter used to persist the results
- Returns:
- the number of similarities precomputed
- Throws:
IOException
RuntimeException - if the computation takes longer than maxDurationInHours
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.