## org.apache.mahout.cf.taste.recommender
Interface ItemBasedRecommender

All Superinterfaces:
  Recommender, Refreshable

All Known Implementing Classes:
  GenericBooleanPrefItemBasedRecommender, GenericItemBasedRecommender

    public interface ItemBasedRecommender

extends Recommender

Interface implemented by "item-based" recommenders.

Method Summary
`List<RecommendedItem>` `mostSimilarItems(long[] itemIDs, int howMany)`
`List<RecommendedItem>` `mostSimilarItems(long[] itemIDs, int howMany, boolean excludeItemIfNotSimilarToAll)`
`List<RecommendedItem>` `mostSimilarItems(long[] itemIDs, int howMany, Rescorer<LongPair> rescorer)`
`List<RecommendedItem>` `mostSimilarItems(long[] itemIDs, int howMany, Rescorer<LongPair> rescorer, boolean excludeItemIfNotSimilarToAll)`
`List<RecommendedItem>` `mostSimilarItems(long itemID, int howMany)`
`List<RecommendedItem>` `mostSimilarItems(long itemID, int howMany, Rescorer<LongPair> rescorer)`
`List<RecommendedItem>` `recommendedBecause(long userID, long itemID, int howMany)` Lists the items that were most influential in recommending a given item to a given user.

Methods inherited from interface org.apache.mahout.cf.taste.recommender.Recommender
`estimatePreference, getDataModel, recommend, recommend, removePreference, setPreference`

Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable
`refresh`

Method Detail

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long itemID,
                                           int howMany)
                                           throws TasteException

  Parameters:
    `itemID` - ID of item for which to find most similar other items
    `howMany` - desired number of most similar items to find
  Returns:
    items most similar to the given item, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long itemID,
                                           int howMany,
                                           Rescorer<LongPair> rescorer)
                                           throws TasteException

  Parameters:
    `itemID` - ID of item for which to find most similar other items
    `howMany` - desired number of most similar items to find
    `rescorer` - `Rescorer` which can adjust item-item similarity estimates used to determine most similar items
  Returns:
    itemss most similar to the given item, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long[] itemIDs,
                                           int howMany)
                                           throws TasteException

  Parameters:
    `itemIDs` - IDs of item for which to find most similar other items
    `howMany` - desired number of most similar items to find estimates used to determine most similar items
  Returns:
    items most similar to the given items, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long[] itemIDs,
                                           int howMany,
                                           Rescorer<LongPair> rescorer)
                                           throws TasteException

  Parameters:
    `itemIDs` - IDs of item for which to find most similar other items
    `howMany` - desired number of most similar items to find
    `rescorer` - `Rescorer` which can adjust item-item similarity estimates used to determine most similar items
  Returns:
    items most similar to the given items, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long[] itemIDs,
                                           int howMany,
                                           boolean excludeItemIfNotSimilarToAll)
                                           throws TasteException

  Parameters:
    `itemIDs` - IDs of item for which to find most similar other items
    `howMany` - desired number of most similar items to find
    `excludeItemIfNotSimilarToAll` - exclude an item if it is not similar to each of the input items
  Returns:
    items most similar to the given items, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### mostSimilarItems

    List<RecommendedItem> mostSimilarItems(long[] itemIDs,
                                           int howMany,
                                           Rescorer<LongPair> rescorer,
                                           boolean excludeItemIfNotSimilarToAll)
                                           throws TasteException

  Parameters:
    `itemIDs` - IDs of item for which to find most similar other items
    `howMany` - desired number of most similar items to find
    `rescorer` - `Rescorer` which can adjust item-item similarity estimates used to determine most similar items
    `excludeItemIfNotSimilarToAll` - exclude an item if it is not similar to each of the input items
  Returns:
    items most similar to the given items, ordered from most similar to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

### recommendedBecause

    List<RecommendedItem> recommendedBecause(long userID,
                                             long itemID,
                                             int howMany)
                                             throws TasteException

  Lists the items that were most influential in recommending a given item to a given user. Exactly how this is determined is left to the implementation, but, generally this will return items that the user prefers and that are similar to the given item.

  This returns a `List` of `RecommendedItem` which is a little misleading since it's returning recommending items, but, I thought it more natural to just reuse this class since it encapsulates an item and value. The value here does not necessarily have a consistent interpretation or expected range; it will be higher the more influential the item was in the recommendation.

  Parameters:
    `userID` - ID of user who was recommended the item
    `itemID` - ID of item that was recommended
    `howMany` - maximum number of items to return
  Returns:
    `List` of `RecommendedItem`, ordered from most influential in recommended the given item to least
  Throws:
    `TasteException` - if an error occurs while accessing the `DataModel`

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