public abstract class AbstractGlobalItemRecommender extends Object implements GlobalItemRecommender
GlobalItemRecommender
by delegating them to general methods with
fastutil-based interfaces.Constructor and Description |
---|
AbstractGlobalItemRecommender() |
Modifier and Type | Method and Description |
---|---|
protected abstract List<ScoredId> |
globalRecommend(LongSet items,
int n,
LongSet candidates,
LongSet exclude)
Implementation method for global item recommendation.
|
List<ScoredId> |
globalRecommend(Set<Long> items)
Recommend all possible items for a basket of items using the default exclude set.
|
List<ScoredId> |
globalRecommend(Set<Long> items,
int n)
Recommend up to n items for a basket of items using the default exclude set.
|
List<ScoredId> |
globalRecommend(Set<Long> items,
int n,
Set<Long> candidates,
Set<Long> exclude)
Produce a set of recommendations for the item.
|
List<ScoredId> |
globalRecommend(Set<Long> items,
Set<Long> candidates)
Recommend all possible items for a basket of items from a set of candidates using the default
exclude set.
|
public List<ScoredId> globalRecommend(Set<Long> items)
Delegates to globalRecommend(LongSet, int, LongSet, LongSet)
.
globalRecommend
in interface GlobalItemRecommender
items
- The items value.GlobalItemRecommender.globalRecommend(Set, int, Set, Set)
public List<ScoredId> globalRecommend(Set<Long> items, int n)
Delegates to globalRecommend(LongSet, int, LongSet, LongSet)
.
globalRecommend
in interface GlobalItemRecommender
items
- The items value.n
- The number of recommendations to return.GlobalItemRecommender.globalRecommend(Set, int, Set, Set)
public List<ScoredId> globalRecommend(Set<Long> items, @Nullable Set<Long> candidates)
Delegates to globalRecommend(LongSet, int, LongSet, LongSet)
.
globalRecommend
in interface GlobalItemRecommender
items
- The items value.candidates
- The candidate set (can be null to represent the universe).GlobalItemRecommender.globalRecommend(Set, int, Set, Set)
public List<ScoredId> globalRecommend(Set<Long> items, int n, @Nullable Set<Long> candidates, @Nullable Set<Long> exclude)
Delegates to globalRecommend(LongSet, int, LongSet, LongSet)
.
globalRecommend
in interface GlobalItemRecommender
items
- The items valuen
- The number of ratings to return. If negative, no specific size is requested.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
.protected abstract List<ScoredId> globalRecommend(LongSet items, int n, @Nullable LongSet candidates, @Nullable LongSet exclude)
items
- The items ID.n
- The number of items to return, or negative to return all
possible items.candidates
- The candidate set.exclude
- The set of excluded items, or null
to use the
default exclude set.GlobalItemRecommender.globalRecommend(Set, int, Set, Set)