public interface UserSimilarity extends Refreshable
Implementations of this interface define a notion of similarity between two users. Implementations should return values in the range -1.0 to 1.0, with 1.0 representing perfect similarity.
ItemSimilarity| Modifier and Type | Method and Description |
|---|---|
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.
|
refreshdouble userSimilarity(long userID1,
long userID2)
throws TasteException
Returns the degree of similarity, of two users, based on the their preferences.
userID1 - first user IDuserID2 - second user IDDouble.NaN similarity is unknownNoSuchUserException - if either user is known to be non-existent in the dataTasteException - if an error occurs while accessing the datavoid setPreferenceInferrer(PreferenceInferrer inferrer)
Attaches a PreferenceInferrer to the UserSimilarity implementation.
inferrer - PreferenceInferrerCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.