public final class RandomRecommender extends AbstractRecommender
Constructor and Description |
---|
RandomRecommender(DataModel dataModel) |
Modifier and Type | Method and Description |
---|---|
float |
estimatePreference(long userID,
long itemID) |
List<RecommendedItem> |
recommend(long userID,
int howMany,
IDRescorer rescorer,
boolean includeKnownItems) |
void |
refresh(Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation.
|
getAllOtherItems, getDataModel, getDefaultCandidateItemsStrategy, recommend, recommend, recommend, removePreference, setPreference
public RandomRecommender(DataModel dataModel) throws TasteException
TasteException
public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer, boolean includeKnownItems) throws TasteException
userID
- user for which recommendations are to be computedhowMany
- desired number of recommendationsrescorer
- rescoring function to apply before final list of recommendations is determinedincludeKnownItems
- whether to include items already known by the user in recommendationsList
of recommended RecommendedItem
s, ordered from most strongly recommend to
leastTasteException
- if an error occurs while accessing the DataModel
public float estimatePreference(long userID, long itemID)
userID
- user ID whose preference is to be estimateditemID
- item ID to estimate preference forDouble.NaN
public void refresh(Collection<Refreshable> alreadyRefreshed)
Refreshable
Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any
Refreshable
should always leave itself in a consistent, operational state, and that the refresh
atomically updates internal state from old to new.
alreadyRefreshed
- Refreshable
s that are known to have already been
refreshed as a result of an initial call to a {#refresh(Collection)} method on some
object. This ensure that objects in a refresh dependency graph aren't refreshed twice
needlessly.Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.