org.apache.mahout.cf.taste.similarity
Interface ItemSimilarity

All Superinterfaces:
Refreshable
All Known Implementing Classes:
AbstractJDBCItemSimilarity, CachingItemSimilarity, EuclideanDistanceSimilarity, GenericItemSimilarity, LogLikelihoodSimilarity, MySQLJDBCItemSimilarity, PearsonCorrelationSimilarity, TanimotoCoefficientSimilarity

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.

See Also:
UserSimilarity

Method Summary
 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.
 
Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable
refresh
 

Method Detail

itemSimilarity

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.

Parameters:
itemID1 - first item ID
itemID2 - second item ID
Returns:
similarity between the items, in [-1,1]
Throws:
TasteException - if an error occurs while accessing the data


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.