|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.data.DataSet
org.mymedialite.data.PosOnlyFeedback<T>
public class PosOnlyFeedback<T extends IBooleanMatrix>
Data structure for implicit, positive-only user feedback. This data structure supports incremental updates.
Field Summary | |
---|---|
IBooleanMatrix |
itemMatrix
By-item access, items are stored in the rows, users in the columns |
IBooleanMatrix |
userMatrix
By-user access, users are stored in the rows, items in the columns |
Fields inherited from class org.mymedialite.data.DataSet |
---|
byItem, byUser, items, maxItemID, maxUserID, users |
Constructor Summary | |
---|---|
PosOnlyFeedback(java.lang.Class<T> c)
Create a PosOnlyFeedback object. |
Method Summary | |
---|---|
void |
add(int user_id,
int item_id)
Add a user-item event to the data structure |
IBooleanMatrix |
getItemMatrixCopy()
Get a copy of the item matrix |
IBooleanMatrix |
getUserMatrixCopy()
Get a copy of the user matrix |
IBooleanMatrix |
itemMatrix()
By-item access, items are stored in the rows, users in the columns. |
void |
remove(int index)
Remove the event with a given index |
void |
remove(int user_id,
int item_id)
Remove a user-item event from the data structure. |
void |
removeItem(int item_id)
Remove all feedback about a given item |
void |
removeUser(int user_id)
Remove all feedback by a given user. |
IPosOnlyFeedback |
transpose()
Get the transpose of the dataset (users and items exchanged) |
IBooleanMatrix |
userMatrix()
By-user access, users are stored in the rows, items in the columns. |
Methods inherited from class org.mymedialite.data.DataSet |
---|
allItems, allUsers, buildItemIndices, buildRandomIndex, buildUserIndices, byItem, byUser, getIndex, getIndex, getItems, getUsers, items, maxItemID, maxUserID, randomIndex, size, tryGetIndex, tryGetIndex, users |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mymedialite.data.IDataSet |
---|
allItems, allUsers, buildItemIndices, buildRandomIndex, buildUserIndices, byItem, byUser, getIndex, getIndex, getItems, getUsers, items, maxItemID, maxUserID, randomIndex, size, tryGetIndex, tryGetIndex, users |
Field Detail |
---|
public IBooleanMatrix userMatrix
public IBooleanMatrix itemMatrix
Constructor Detail |
---|
public PosOnlyFeedback(java.lang.Class<T> c) throws java.lang.InstantiationException, java.lang.IllegalAccessException
c
- the Classjava.lang.InstantiationException
java.lang.IllegalAccessException
Method Detail |
---|
public IBooleanMatrix userMatrix()
userMatrix
in interface IPosOnlyFeedback
public IBooleanMatrix itemMatrix()
itemMatrix
in interface IPosOnlyFeedback
public IBooleanMatrix getUserMatrixCopy()
IPosOnlyFeedback
getUserMatrixCopy
in interface IPosOnlyFeedback
public IBooleanMatrix getItemMatrixCopy()
IPosOnlyFeedback
getItemMatrixCopy
in interface IPosOnlyFeedback
public void add(int user_id, int item_id)
add
in interface IPosOnlyFeedback
user_id
- the user IDitem_id
- the item IDpublic void remove(int user_id, int item_id)
remove
in interface IPosOnlyFeedback
user_id
- the user IDitem_id
- >the item IDpublic void remove(int index)
index
- the index of the event to be removedpublic void removeUser(int user_id)
removeUser
in interface IDataSet
user_id
- the user IDpublic void removeItem(int item_id)
removeItem
in interface IDataSet
item_id
- the item IDpublic IPosOnlyFeedback transpose()
IPosOnlyFeedback
transpose
in interface IPosOnlyFeedback
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |