public interface ItemBasedItemRecommender
Recommends items that go with a set of reference items. This interface is distinguished from ItemRecommender
in that it uses a set of reference items instead of a user as the basis for computing scores.
ItemRecommender
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Long> |
recommendRelatedItems(long reference)
Recommend all possible items for a reference item using the default exclude set.
|
java.util.List<java.lang.Long> |
recommendRelatedItems(long reference,
int n)
Recommend up to n possible items for a reference item using the default exclude set.
|
java.util.List<java.lang.Long> |
recommendRelatedItems(java.util.Set<java.lang.Long> basket)
Recommend all possible items for a set of reference items using the default exclude set.
|
java.util.List<java.lang.Long> |
recommendRelatedItems(java.util.Set<java.lang.Long> basket,
int n)
Recommend up to n items for a set of reference items using the default exclude set.
|
java.util.List<java.lang.Long> |
recommendRelatedItems(java.util.Set<java.lang.Long> basket,
int n,
java.util.Set<java.lang.Long> candidates,
java.util.Set<java.lang.Long> exclude)
Produce a set of recommendations for the item.
|
ResultList |
recommendRelatedItemsWithDetails(java.util.Set<java.lang.Long> basket,
int n,
java.util.Set<java.lang.Long> candidates,
java.util.Set<java.lang.Long> exclude)
Produce a set of recommendations for the item, with details.
|
java.util.List<java.lang.Long> recommendRelatedItems(long reference)
Recommend all possible items for a reference item using the default exclude set.
reference
- The reference item.recommendRelatedItems(Set, int, Set, Set)
java.util.List<java.lang.Long> recommendRelatedItems(long reference, int n)
Recommend up to n possible items for a reference item using the default exclude set.
reference
- The reference item.n
- The number of items to recommend. If negative, recommend as many as possible.recommendRelatedItems(Set, int, Set, Set)
java.util.List<java.lang.Long> recommendRelatedItems(java.util.Set<java.lang.Long> basket)
Recommend all possible items for a set of reference items using the default exclude set.
basket
- The reference items.recommendRelatedItems(Set, int, Set, Set)
java.util.List<java.lang.Long> recommendRelatedItems(java.util.Set<java.lang.Long> basket, int n)
Recommend up to n items for a set of reference items using the default exclude set.
basket
- The reference items.n
- The number of recommendations to return. If negative, recommend as many as possible.recommendRelatedItems(Set, int, Set, Set)
java.util.List<java.lang.Long> recommendRelatedItems(java.util.Set<java.lang.Long> basket, int n, @Nullable java.util.Set<java.lang.Long> candidates, @Nullable java.util.Set<java.lang.Long> exclude)
Produce a set of recommendations for the item. This is the most general recommendation method, allowing the recommendations to be constrained by both a candidate set \(\mathcal{C}\) and an exclude set \(\mathcal{E}\). The exclude set is applied to the candidate set, so the final effective candidate set is \(\mathcal{C} \backslash \mathcal{E}\).
The recommender is not guaranteed to return a full n
recommendations. There are many reasons why it might return a shorter list, including lack of items, lack of coverage for items, or a predefined notion of a maximum recommendation list length. However, a negative value for n
instructs the recommender to return as many as it can consistent with any limitations built in to its design and/or supporting algorithms.
basket
- The reference items.n
- The number of ratings to return. If negative, recommend as many as possible.candidates
- A set of candidate items which can be recommended. If null
, all items are considered candidates.exclude
- A set of items to be excluded. If null
, a default exclude set is used.ResultList recommendRelatedItemsWithDetails(java.util.Set<java.lang.Long> basket, int n, @Nullable java.util.Set<java.lang.Long> candidates, @Nullable java.util.Set<java.lang.Long> exclude)
Produce a set of recommendations for the item, with details. This method functions identically to recommendRelatedItems(Set, int, Set, Set)
, except that it returns more detailed results.
basket
- The reference items.n
- The number of ratings to return. If negative, recommend as many as possible.candidates
- A set of candidate items which can be recommended. If null
, all items are considered candidates.exclude
- A set of items to be excluded. If null
, a default exclude set is used.Double.NaN
.