|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRatings
Interface for rating datasets.
Method Summary | |
---|---|
void |
add(int user_id,
int item_id,
byte rating)
Add byte-valued rating to the collection. |
void |
add(int user_id,
int item_id,
double rating)
Add a new rating. |
void |
add(int user_id,
int item_id,
float rating)
Add float-valued rating to the collection. |
double |
average()
Average rating in the dataset. |
IntList |
countByItem()
Get the rating count by item. |
IntList |
countByUser()
Get the rating count by user. |
double |
get(int index)
Directly access ratings. |
double |
get(int userId,
int itemId)
Directly access rating by user and item |
double |
get(int user_id,
int item_id,
IntCollection indexes)
Directly access rating by user and item. |
double |
maxRating()
Get the maximum rating in the dataset. |
double |
minRating()
Get the minimum rating in the dataset. |
void |
removeAt(int index)
Remove the rating at the specified index |
double |
set(int index,
double rating)
Directly access the ratings |
int |
size()
|
java.lang.Double |
tryGet(int user_id,
int item_id)
Try to retrieve a rating for a given user-item combination. |
java.lang.Double |
tryGet(int user_id,
int item_id,
IntCollection indexes)
Try to retrieve a rating for a given user-item combination. |
DoubleList |
values()
|
Methods inherited from interface org.mymedialite.data.IDataSet |
---|
allItems, allUsers, buildItemIndices, buildRandomIndex, buildUserIndices, byItem, byUser, getIndex, getIndex, getItems, getUsers, items, maxItemID, maxUserID, randomIndex, removeItem, removeUser, tryGetIndex, tryGetIndex, users |
Method Detail |
---|
int size()
size
in interface IDataSet
double maxRating()
double minRating()
IntList countByUser()
IntList countByItem()
double average()
DoubleList values()
double get(int userId, int itemId)
userId
- the user IDitemId
- the item ID
double get(int index)
index
- the index of the rating
double set(int index, double rating)
index
- the rating indexrating
- the rating valuejava.lang.Double tryGet(int user_id, int item_id)
user_id
- the user IDitem_id
- the item ID
java.lang.Double tryGet(int user_id, int item_id, IntCollection indexes)
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
double get(int user_id, int item_id, IntCollection indexes)
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
void add(int user_id, int item_id, byte rating)
user_id
- the user IDitem_id
- the item IDrating
- the ratingvoid add(int user_id, int item_id, float rating)
user_id
- the user IDitem_id
- the item IDrating
- the ratingvoid add(int user_id, int item_id, double rating)
user_id
- the user IDitem_id
- the item IDrating
- the rating valuevoid removeAt(int index)
index
- the rating index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |