|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planetj.taste.impl.correlation.SpearmanCorrelation
public final class SpearmanCorrelation
Like PearsonCorrelation, but compares relative ranking of preference values instead of preference
values themselves. That is, each User's preferences are sorted and then assign a rank as their preference
value, with 1 being assigned to the least preferred item. Then the Pearson itemCorrelation of these rank values is
computed.
| Constructor Summary | |
|---|---|
SpearmanCorrelation(DataModel dataModel)
|
|
SpearmanCorrelation(UserCorrelation rankingUserCorrelation)
|
|
| Method Summary | |
|---|---|
void |
refresh()
Triggers "refresh" -- whatever that means -- of the implementation. |
void |
setPreferenceInferrer(PreferenceInferrer inferrer)
Attaches a |
double |
userCorrelation(User user1,
User user2)
Returns the "itemCorrelation", or degree of similarity, of two |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpearmanCorrelation(DataModel dataModel)
public SpearmanCorrelation(UserCorrelation rankingUserCorrelation)
| Method Detail |
|---|
public double userCorrelation(User user1,
User user2)
throws TasteException
Returns the "itemCorrelation", or degree of similarity, of two Users, based
on the their preferences.
userCorrelation in interface UserCorrelationuser1 - first useruser2 - second user
TasteException - if an error occurs while accessing the datapublic void setPreferenceInferrer(PreferenceInferrer inferrer)
Attaches a PreferenceInferrer to the UserCorrelation implementation.
setPreferenceInferrer in interface UserCorrelationinferrer - PreferenceInferrerpublic void refresh()
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 Refreshable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||