public final class TopN extends Object
| Modifier and Type | Method and Description |
|---|---|
static Queue<MutableRecommendedItem> |
initialQueue(int n) |
static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> |
selectTopN(Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values,
int n) |
static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> |
selectTopNFromQueue(Queue<MutableRecommendedItem> topN,
int n) |
static void |
selectTopNIntoQueue(Queue<MutableRecommendedItem> topN,
Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values,
int n)
Computes top N values for a stream and puts them into a
Queue. |
static void |
selectTopNIntoQueueMultithreaded(Queue<MutableRecommendedItem> topN,
float[] queueLeastValue,
Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values,
int n)
Computes top N values for a stream and puts them into a
Queue. |
public static Queue<MutableRecommendedItem> initialQueue(int n)
n - how many top values to chooseQueue suitable for use in this classpublic static void selectTopNIntoQueue(Queue<MutableRecommendedItem> topN, Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values, int n)
Queue.topN - Queue to add tovalues - stream of values from which to choosen - how many top values to choosepublic static void selectTopNIntoQueueMultithreaded(Queue<MutableRecommendedItem> topN, float[] queueLeastValue, Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values, int n)
Queue.
Used in the context of multiple threads.topN - Queue to add toqueueLeastValue - in/out parameter caching the queue's least valuevalues - stream of values from which to choosen - how many top values to choosepublic static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> selectTopNFromQueue(Queue<MutableRecommendedItem> topN, int n)
topN - Queue of items from which to take top nn - how many top values to choosepublic static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> selectTopN(Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values, int n)
values - stream of values from which to choosen - how many top values to chooseCopyright © 2012. All Rights Reserved.