net.myrrix.common
Class TopN

java.lang.Object
  extended by net.myrrix.common.TopN

public final class TopN
extends Object

Utility methods for finding the top N things from a stream.

Author:
Sean Owen, Mahout

Method Summary
static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> selectTopN(Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values, int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

selectTopN

public static List<org.apache.mahout.cf.taste.recommender.RecommendedItem> selectTopN(Iterator<org.apache.mahout.cf.taste.recommender.RecommendedItem> values,
                                                                                      int n)
Parameters:
values - stream of values from which to choose
n - how many top values to choose
Returns:
the top N values (at most), ordered by value descending.


Copyright © 2012. All Rights Reserved.