public final class GenericUserSimilarity extends Object implements UserSimilarity
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericUserSimilarity.UserUserSimilarity |
| Constructor and Description |
|---|
GenericUserSimilarity(Iterable<GenericUserSimilarity.UserUserSimilarity> similarities) |
GenericUserSimilarity(Iterable<GenericUserSimilarity.UserUserSimilarity> similarities,
int maxToKeep) |
GenericUserSimilarity(UserSimilarity otherSimilarity,
DataModel dataModel) |
GenericUserSimilarity(UserSimilarity otherSimilarity,
DataModel dataModel,
int maxToKeep) |
| Modifier and Type | Method and Description |
|---|---|
void |
refresh(Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation.
|
void |
setPreferenceInferrer(PreferenceInferrer inferrer)
Attaches a
PreferenceInferrer to the UserSimilarity implementation. |
double |
userSimilarity(long userID1,
long userID2)
Returns the degree of similarity, of two users, based on the their preferences.
|
public GenericUserSimilarity(Iterable<GenericUserSimilarity.UserUserSimilarity> similarities)
public GenericUserSimilarity(Iterable<GenericUserSimilarity.UserUserSimilarity> similarities, int maxToKeep)
public GenericUserSimilarity(UserSimilarity otherSimilarity, DataModel dataModel) throws TasteException
TasteExceptionpublic GenericUserSimilarity(UserSimilarity otherSimilarity, DataModel dataModel, int maxToKeep) throws TasteException
TasteExceptionpublic double userSimilarity(long userID1,
long userID2)
UserSimilarityReturns the degree of similarity, of two users, based on the their preferences.
userSimilarity in interface UserSimilarityuserID1 - first user IDuserID2 - second user IDDouble.NaN similarity is unknownpublic void setPreferenceInferrer(PreferenceInferrer inferrer)
UserSimilarity
Attaches a PreferenceInferrer to the UserSimilarity implementation.
setPreferenceInferrer in interface UserSimilarityinferrer - PreferenceInferrerpublic 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.
refresh in interface RefreshablealreadyRefreshed - Refreshables 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.