## org.apache.mahout.cf.taste.impl.recommender
Class TopItems

    java.lang.Object
      org.apache.mahout.cf.taste.impl.recommender.TopItems

    public final class TopItems

extends Object

A simple class that refactors the "find top N things" logic that is used in several places.

Nested Class Summary
`static interface` `TopItems.Estimator<T>`

Method Summary
`static List<GenericItemSimilarity.ItemItemSimilarity>` `getTopItemItemSimilarities(int howMany, Iterator<GenericItemSimilarity.ItemItemSimilarity> allSimilarities)` Thanks to tsmorton for suggesting this functionality and writing part of the code.
`static List<RecommendedItem>` `getTopItems(int howMany, LongPrimitiveIterator possibleItemIDs, IDRescorer rescorer, TopItems.Estimator<Long> estimator)`
`static long[]` `getTopUsers(int howMany, LongPrimitiveIterator allUserIDs, IDRescorer rescorer, TopItems.Estimator<Long> estimator)`
`static List<GenericUserSimilarity.UserUserSimilarity>` `getTopUserUserSimilarities(int howMany, Iterator<GenericUserSimilarity.UserUserSimilarity> allSimilarities)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getTopItems

    public static List<RecommendedItem> getTopItems(int howMany,
                                                    LongPrimitiveIterator possibleItemIDs,
                                                    IDRescorer rescorer,
                                                    TopItems.Estimator<Long> estimator)
                                             throws TasteException

  Throws:
    `TasteException`

### getTopUsers

    public static long[] getTopUsers(int howMany,
                                     LongPrimitiveIterator allUserIDs,
                                     IDRescorer rescorer,
                                     TopItems.Estimator<Long> estimator)
                              throws TasteException

  Throws:
    `TasteException`

### getTopItemItemSimilarities

    public static List<GenericItemSimilarity.ItemItemSimilarity> getTopItemItemSimilarities(int howMany,
                                                                                            Iterator<GenericItemSimilarity.ItemItemSimilarity> allSimilarities)

  Thanks to tsmorton for suggesting this functionality and writing part of the code.

  See Also:
    `GenericItemSimilarity.GenericItemSimilarity(Iterable, int)`, `GenericItemSimilarity.GenericItemSimilarity(org.apache.mahout.cf.taste.similarity.ItemSimilarity, org.apache.mahout.cf.taste.model.DataModel, int)`

### getTopUserUserSimilarities

    public static List<GenericUserSimilarity.UserUserSimilarity> getTopUserUserSimilarities(int howMany,
                                                                                            Iterator<GenericUserSimilarity.UserUserSimilarity> allSimilarities)

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.