|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataModel
Implementations represent a repository of information about users and their associated Preferences
for items.
| Method Summary | |
|---|---|
LongPrimitiveIterator |
getItemIDs()
|
FastIDSet |
getItemIDsFromUser(long userID)
|
float |
getMaxPreference()
|
float |
getMinPreference()
|
int |
getNumItems()
|
int |
getNumUsers()
|
int |
getNumUsersWithPreferenceFor(long itemID)
|
int |
getNumUsersWithPreferenceFor(long itemID1,
long itemID2)
|
PreferenceArray |
getPreferencesForItem(long itemID)
|
PreferenceArray |
getPreferencesFromUser(long userID)
|
Long |
getPreferenceTime(long userID,
long itemID)
Retrieves the time at which a preference value from a user and item was set, if known. |
Float |
getPreferenceValue(long userID,
long itemID)
Retrieves the preference value for a single user and item. |
LongPrimitiveIterator |
getUserIDs()
|
boolean |
hasPreferenceValues()
|
void |
removePreference(long userID,
long itemID)
Removes a particular preference for a user. |
void |
setPreference(long userID,
long itemID,
float value)
Sets a particular preference (item plus rating) for a user. |
| Methods inherited from interface org.apache.mahout.cf.taste.common.Refreshable |
|---|
refresh |
| Method Detail |
|---|
LongPrimitiveIterator getUserIDs()
throws TasteException
TasteException - if an error occurs while accessing the data
PreferenceArray getPreferencesFromUser(long userID)
throws TasteException
userID - ID of user to get prefs for
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the data
FastIDSet getItemIDsFromUser(long userID)
throws TasteException
userID - ID of user to get prefs for
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the data
LongPrimitiveIterator getItemIDs()
throws TasteException
LongPrimitiveIterator of all item IDs in the model, in order
TasteException - if an error occurs while accessing the data
PreferenceArray getPreferencesForItem(long itemID)
throws TasteException
itemID - item ID
Preferences expressed for that item, ordered by user ID, as an array
NoSuchItemException - if the item does not exist
TasteException - if an error occurs while accessing the data
Float getPreferenceValue(long userID,
long itemID)
throws TasteException
userID - user ID to get pref value fromitemID - item ID to get pref value for
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the data
Long getPreferenceTime(long userID,
long itemID)
throws TasteException
userID - user ID for preference in questionitemID - item ID for preference in question
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the data
int getNumItems()
throws TasteException
TasteException - if an error occurs while accessing the data
int getNumUsers()
throws TasteException
TasteException - if an error occurs while accessing the data
int getNumUsersWithPreferenceFor(long itemID)
throws TasteException
itemID - item ID to check for
TasteException - if an error occurs while accessing the data
int getNumUsersWithPreferenceFor(long itemID1,
long itemID2)
throws TasteException
itemID1 - first item ID to check foritemID2 - second item ID to check for
TasteException - if an error occurs while accessing the data
void setPreference(long userID,
long itemID,
float value)
throws TasteException
Sets a particular preference (item plus rating) for a user.
userID - user to set preference foritemID - item to set preference forvalue - preference value
NoSuchItemException - if the item does not exist
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the data
void removePreference(long userID,
long itemID)
throws TasteException
Removes a particular preference for a user.
userID - user from which to remove preferenceitemID - item to remove preference for
NoSuchItemException - if the item does not exist
NoSuchUserException - if the user does not exist
TasteException - if an error occurs while accessing the databoolean hasPreferenceValues()
float getMaxPreference()
Recommender may estimate a preference value above 5.0, it
isn't "fair" to consider that the system is actually suggesting an impossible rating of, say, 5.4 stars.
In practice the application would cap this estimate to 5.0. Since evaluators evaluate
the difference between estimated and actual value, this at least prevents this effect from unfairly
penalizing a Recommenderfloat getMinPreference()
getMaxPreference()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||