|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataSet
Interface for different kinds of collaborative filtering data sets. Implementing classes/inheriting interfaces are e.g. for rating data and for positive-only implicit feedback. The main feature of a dataset is that it has some kind of order (not explicitly stated) - random, chronological, user-wise, or item-wise - and that it contains tuples of users and items (not necessarily unique tuples). Implementing classes and inheriting interfaces can add additional data to each user-item tuple, e.g. the date/time of an event, location, context, etc., as well as additional index structures to access the dataset in a certain fashion.
Method Summary | |
---|---|
IntList |
allItems()
|
IntList |
allUsers()
|
void |
buildItemIndices()
Build the item indices. |
void |
buildRandomIndex()
Build the random index. |
void |
buildUserIndices()
Build the user indices. |
java.util.List<IntList> |
byItem()
indices by item. |
java.util.List<IntList> |
byUser()
indices by user. |
int |
getIndex(int user_id,
int item_id)
Get index for a given user and item. |
int |
getIndex(int user_id,
int item_id,
IntCollection indexes)
Get index for given user and item. |
IntSet |
getItems(IntList indices)
Get all items that are referenced by a given list of indices. |
IntSet |
getUsers(IntList indices)
Get all users that are referenced by a given list of indices. |
IntList |
items()
|
int |
maxItemID()
|
int |
maxUserID()
|
IntList |
randomIndex()
get a randomly ordered list of all indices. |
void |
removeItem(int item_id)
Remove all events related to a given item. |
void |
removeUser(int user_id)
Remove all events related to a given user. |
int |
size()
|
java.lang.Integer |
tryGetIndex(int user_id,
int item_id)
Try to get the index for given user and item. |
java.lang.Integer |
tryGetIndex(int user_id,
int item_id,
IntCollection indexes)
Try to get the index for given user and item. |
IntList |
users()
|
Method Detail |
---|
int size()
IntList users()
IntList items()
int maxUserID()
int maxItemID()
IntList allUsers()
IntList allItems()
java.util.List<IntList> byUser()
java.util.List<IntList> byItem()
IntList randomIndex()
void buildUserIndices()
void buildItemIndices()
void buildRandomIndex()
void removeUser(int user_id)
user_id
- the user IDvoid removeItem(int item_id)
item_id
- the item IDIntSet getUsers(IntList indices)
indices
- the indices to take into account
IntSet getItems(IntList indices)
indices
- the indices to take into account
int getIndex(int user_id, int item_id)
user_id
- the user IDitem_id
- the item ID
int getIndex(int user_id, int item_id, IntCollection indexes)
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
java.lang.Integer tryGetIndex(int user_id, int item_id)
user_id
- the user IDitem_id
- the item ID
java.lang.Integer tryGetIndex(int user_id, int item_id, IntCollection indexes)
user_id
- the user IDitem_id
- the item IDindexes
- the indexes to look at
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |