|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.algorithms.SimilarityWeight
Represents the similarity between the active user (or item) and some neighbor user (or item). The ID of the active user (or item) is not actually stored; it is assumed that users of this class will keep track of that or infer it from context. Used by many nearest-neighbor algorithms of various varieties. This was once called "CorrelationCoeff", but its name was changed since it was being used for more than just correlations.
Constructor Summary | |
SimilarityWeight(int neighborID,
float weight)
Construct a new SimilarityWeight. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Implementation of the Comparable interface. |
int |
getNeighborID()
Returns the ID representing the neighbor we are considering. |
float |
getWeight()
Returns the similarity weight for this neighbor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimilarityWeight(int neighborID, float weight)
neighborID
- ID representing the neighbor in question.weight
- degree of similarity to neighborMethod Detail |
public int getNeighborID()
public float getWeight()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |