public interface ItemSimilarity extends Refreshable
Implementations of this interface define a notion of similarity between two items. Implementations should return values in the range -1.0 to 1.0, with 1.0 representing perfect similarity.
UserSimilarity
Modifier and Type | Method and Description |
---|---|
long[] |
allSimilarItemIDs(long itemID) |
double[] |
itemSimilarities(long itemID1,
long[] itemID2s)
A bulk-get version of
itemSimilarity(long, long) . |
double |
itemSimilarity(long itemID1,
long itemID2)
Returns the degree of similarity, of two items, based on the preferences that users have expressed for
the items.
|
refresh
double itemSimilarity(long itemID1, long itemID2) throws TasteException
Returns the degree of similarity, of two items, based on the preferences that users have expressed for the items.
itemID1
- first item IDitemID2
- second item IDDouble.NaN
similarity is unknownNoSuchItemException
- if either item is known to be non-existent in the dataTasteException
- if an error occurs while accessing the datadouble[] itemSimilarities(long itemID1, long[] itemID2s) throws TasteException
A bulk-get version of itemSimilarity(long, long)
.
itemID1
- first item IDitemID2s
- second item IDs to compute similarity withNoSuchItemException
- if any item is known to be non-existent in the dataTasteException
- if an error occurs while accessing the datalong[] allSimilarItemIDs(long itemID) throws TasteException
TasteException
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.