MyMediaLite
3.11
|
Data structure for storing ratings with time information More...
Public Member Functions | |
override void | Add (int user_id, int item_id, float rating) |
Add float-valued rating to the collection More... | |
virtual void | Add (int user_id, int item_id, float rating, DateTime time) |
add a rating event including time information More... | |
virtual void | Add (int user_id, int item_id, byte rating) |
Add byte-valued rating to the collection More... | |
void | Add (float item) |
void | Clear () |
bool | Contains (float item) |
void | CopyTo (float[] array, int index) |
virtual float | Get (int user_id, int item_id, ICollection< int > indexes) |
Directly access rating by user and item More... | |
int | GetIndex (int user_id, int item_id) |
Get index for a given user and item More... | |
int | GetIndex (int user_id, int item_id, ICollection< int > indexes) |
Get index for given user and item More... | |
ISet< int > | GetItems (IList< int > indices) |
Get all items that are referenced by a given list of indices More... | |
override void | GetObjectData (SerializationInfo info, StreamingContext context) |
ISet< int > | GetUsers (IList< int > indices) |
Get all users that are referenced by a given list of indices More... | |
int | IndexOf (float item) |
virtual void | InitScale () |
Initialize the Scale property More... | |
void | Insert (int index, float item) |
bool | Remove (float item) |
virtual void | RemoveAt (int index) |
override void | RemoveItem (int item_id) |
Remove all events related to a given item More... | |
override void | RemoveUser (int user_id) |
Remove all events related to a given user More... | |
TimedRatings () | |
Default constructor More... | |
TimedRatings (SerializationInfo info, StreamingContext context) | |
virtual bool | TryGet (int user_id, int item_id, out float rating) |
Try to retrieve a rating for a given user-item combination More... | |
virtual bool | TryGet (int user_id, int item_id, ICollection< int > indexes, out float rating) |
Try to retrieve a rating for a given user-item combination More... | |
bool | TryGetIndex (int user_id, int item_id, out int index) |
Try to get the index for given user and item More... | |
bool | TryGetIndex (int user_id, int item_id, ICollection< int > indexes, out int index) |
Try to get the index for given user and item More... | |
Protected Member Functions | |
void | UpdateCountsAndIndices (ISet< int > users, ISet< int > items) |
update user- and item-wise counts and indices More... | |
Protected Attributes | |
IList< IList< int > > | by_item |
Indices organized by item More... | |
IList< IList< int > > | by_user |
Indices organized by user More... | |
IList< int > | count_by_item |
field for storing the count per item More... | |
IList< int > | count_by_user |
field for storing the count per user More... | |
IList< float > | Values |
Properties | |
IList< int > | AllItems [get] |
IList< int > | AllUsers [get] |
float | Average [get] |
IList< IList< int > > | ByItem [get] |
IList< IList< int > > | ByUser [get] |
new int | Count [get] |
virtual int | Count [get] |
IList< int > | CountByItem [get] |
IList< int > | CountByUser [get] |
DateTime | EarliestTime [get, protected set] |
bool | IsReadOnly [get] |
IList< int > | Items [get, protected set] |
DateTime | LatestTime [get, protected set] |
int | MaxItemID [get, protected set] |
int | MaxUserID [get, protected set] |
IList< int > | RandomIndex [get] |
RatingScale | Scale [get, protected set] |
virtual float | this[int index] [get, set] |
virtual float | this[int user_id, int item_id] [get] |
IList< DateTime > | Times [get, protected set] |
IList< int > | Users [get, protected set] |
Data structure for storing ratings with time information
This data structure supports incremental updates.
Loading the Netflix Prize data set (100,000,000 ratings) into this data structure requires about 3.2 GB of memory.
|
inline |
Default constructor
|
inlinevirtual |
Add float-valued rating to the collection
user_id | the user ID |
item_id | the item ID |
rating | the rating |
Reimplemented from Ratings.
|
inlinevirtual |
add a rating event including time information
It is up to the user of a class implementing this interface to decide whether the DateTime object represent local time, UTC, or any other time.
user_id | the user ID |
item_id | the item ID |
rating | the rating value |
time | A DateTime specifying the time of the rating event |
Implements ITimedRatings.
|
inlinevirtualinherited |
Add byte-valued rating to the collection
user_id | the user ID |
item_id | the item ID |
rating | the rating |
Implements IRatings.
Reimplemented in StaticByteRatings.
|
inlinevirtualinherited |
Directly access rating by user and item
user_id | the user ID |
item_id | the item ID |
indexes | the indexes to look at |
Implements IRatings.
Reimplemented in StaticByteRatings.
|
inlineinherited |
Get index for a given user and item
user_id | the user ID |
item_id | the item ID |
Implements IDataSet.
|
inlineinherited |
Get index for given user and item
user_id | the user ID |
item_id | the item ID |
indexes | the indexes to look at |
Implements IDataSet.
|
inlineinherited |
Get all items that are referenced by a given list of indices
indices | the indices to take into account |
Implements IDataSet.
|
inlineinherited |
Get all users that are referenced by a given list of indices
indices | the indices to take into account |
Implements IDataSet.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Remove all events related to a given item
item_id | the item ID |
Implements DataSet.
Reimplemented in StaticRatings, and RatingsProxy.
|
inlinevirtualinherited |
Remove all events related to a given user
user_id | the user ID |
Implements DataSet.
Reimplemented in StaticRatings, and RatingsProxy.
|
inlinevirtualinherited |
Try to retrieve a rating for a given user-item combination
user_id | the user ID |
item_id | the item ID |
rating | will contain the first rating encountered that matches the user ID and item ID |
Implements IRatings.
Reimplemented in StaticByteRatings.
|
inlinevirtualinherited |
Try to retrieve a rating for a given user-item combination
user_id | the user ID |
item_id | the item ID |
indexes | the indexes to look at |
rating | will contain the first rating encountered that matches the user ID and item ID |
Implements IRatings.
Reimplemented in StaticByteRatings.
|
inlineinherited |
Try to get the index for given user and item
user_id | the user ID |
item_id | the item ID |
index | will contain the index of the first event encountered that matches the user ID and item ID |
Implements IDataSet.
|
inlineinherited |
Try to get the index for given user and item
user_id | the user ID |
item_id | the item ID |
indexes | the indexes to look at |
index | will contain the index of the first event encountered that matches the user ID and item ID |
Implements IDataSet.
|
inlineprotectedinherited |
update user- and item-wise counts and indices
users | the modified users |
items | the modified itemsItems. |
|
protectedinherited |
Indices organized by item
|
protectedinherited |
Indices organized by user
|
protectedinherited |
field for storing the count per item
|
protectedinherited |
field for storing the count per user