MyMediaLite
3.11
|
Time-aware bias model More...
Public Member Functions | |
virtual bool | CanPredict (int user_id, int item_id) |
Check whether a useful prediction (i.e. not using a fallback/default answer) can be made for a given user-item combination More... | |
Object | Clone () |
create a shallow copy of the object More... | |
virtual float | ComputeObjective () |
Compute the current optimization objective (usually loss plus regularization term) of the model More... | |
virtual void | Iterate () |
Run one iteration (= pass over the training data) More... | |
virtual void | LoadModel (string file) |
Get the model parameters from a file More... | |
override float | Predict (int user_id, int item_id) |
Predict rating or score for a given user-item combination More... | |
override float | Predict (int user_id, int item_id, DateTime time) |
predict rating at a certain point in time More... | |
IList< Tuple< int, float > > | Recommend (int user_id, int n=-1, ICollection< int > ignore_items=null, ICollection< int > candidate_items=null) |
Recommend items for a given user More... | |
virtual System.Collections.Generic.IList< Tuple< int, float > > | Recommend (int user_id, int n=-1, System.Collections.Generic.ICollection< int > ignore_items=null, System.Collections.Generic.ICollection< int > candidate_items=null) |
virtual void | SaveModel (string file) |
Save the model parameters to a file More... | |
TimeAwareBaseline () | |
default constructor More... | |
override string | ToString () |
Return a string representation of the recommender More... | |
override void | Train () |
Learn the model parameters of the recommender from the training data More... | |
Protected Member Functions | |
virtual void | InitModel () |
Initialize the model parameters More... | |
virtual float | Predict (int user_id, int item_id, int day, int bin) |
Predict the specified user_id, item_id, day and bin More... | |
int | RelativeDay (DateTime datetime) |
Given a DateTime object, return the day relative to the first rating day in the dataset More... | |
virtual void | UpdateParameters (int u, int i, int day, int bin, float err) |
Single stochastic gradient descent step: update the parameter values for one user and one item More... | |
Protected Attributes | |
int | latest_relative_day |
last day in the training data, counting from the first day More... | |
float | max_rating |
Maximum rating value More... | |
float | min_rating |
Minimum rating value More... | |
IRatings | ratings |
rating data More... | |
ITimedRatings | timed_ratings |
rating data, including time information More... | |
Properties | |
float | AlphaLearnRate [get, set] |
learn rate for the user-wise alphas More... | |
float | Beta [get, set] |
beta parameter for modeling the drift in the user bias More... | |
int | BinSize [get, set] |
bin size in days for modeling the time-dependent item bias More... | |
float | ItemBiasByTimeBinLearnRate [get, set] |
learn rate for the bin-wise item bias More... | |
float | ItemBiasLearnRate [get, set] |
learn rate for the item bias More... | |
int | MaxItemID [get, set] |
Maximum item ID More... | |
virtual float | MaxRating [get, set] |
Maximum rating value More... | |
int | MaxUserID [get, set] |
Maximum user ID More... | |
virtual float | MinRating [get, set] |
Minimum rating value More... | |
uint | NumIter [get, set] |
number of iterations over the dataset to perform More... | |
override IRatings | Ratings [get, set] |
float | RegAlpha [get, set] |
regularization for the user-wise alphas More... | |
float | RegI [get, set] |
regularization for the item bias More... | |
float | RegItemBiasByTimeBin [get, set] |
regularization for the bin-wise item bias More... | |
float | RegU [get, set] |
regularization for the user bias More... | |
float | RegUserBiasByDay [get, set] |
regularization for the day-wise user bias More... | |
float | RegUserScaling [get, set] |
regularization for the user scaling factor More... | |
float | RegUserScalingByDay [get, set] |
regularization for the day-wise user scaling factor More... | |
virtual ITimedRatings | TimedRatings [get, set] |
the rating data, including time information More... | |
float | UserBiasByDayLearnRate [get, set] |
learn rate for the day-wise user bias More... | |
float | UserBiasLearnRate [get, set] |
learn rate for the user bias More... | |
float | UserScalingByDayLearnRate [get, set] |
learn rate for the day-wise user scaling factor More... | |
float | UserScalingLearnRate [get, set] |
learn rate for the user-wise scaling factor More... | |
Time-aware bias model
Model described in equation (10) of BellKor Grand Prize documentation for the Netflix Prize (see below). The optimization problem is described in equation (12).
The default hyper-parameter values are set to the ones shown in the report. For datasets other than Netflix, you may want to find better parameters.
Literature:
This recommender does currently NOT support incremental updates.
|
inline |
default constructor
|
inlinevirtualinherited |
Check whether a useful prediction (i.e. not using a fallback/default answer) can be made for a given user-item combination
It is up to the recommender implementor to decide when a prediction is useful, and to document it accordingly.
user_id | the user ID |
item_id | the item ID |
Implements IRecommender.
Reimplemented in ExternalItemRecommender, ExternalRatingPredictor, BiPolarSlopeOne, SlopeOne, Constant, GlobalAverage, UserAverage, ItemAverage, and Random.
|
inlineinherited |
create a shallow copy of the object
|
inlinevirtual |
Compute the current optimization objective (usually loss plus regularization term) of the model
Implements IIterativeModel.
Reimplemented in TimeAwareBaselineWithFrequencies.
|
inlineprotectedvirtual |
Initialize the model parameters
Reimplemented in TimeAwareBaselineWithFrequencies.
|
inlinevirtual |
Run one iteration (= pass over the training data)
Implements IIterativeModel.
|
inlinevirtualinherited |
Get the model parameters from a file
filename | the name of the file to read from |
Implements IRecommender.
Reimplemented in BPRMF, MatrixFactorization, BiasedMatrixFactorization, BPRSLIM, CoClustering, LeastSquareSLIM, SVDPlusPlus, UserItemBaseline, FactorWiseMatrixFactorization, SigmoidCombinedAsymmetricFactorModel, MF, SigmoidSVDPlusPlus, BiPolarSlopeOne, SigmoidItemAsymmetricFactorModel, SigmoidUserAsymmetricFactorModel, KNN, KNN, MostPopular, NaiveBayes, SlopeOne, SLIM, MostPopularByAttributes, EntityAverage, GlobalAverage, ExternalItemRecommender, ExternalRatingPredictor, Constant, Random, Random, and Zero.
|
inlinevirtual |
Predict rating or score for a given user-item combination
user_id | the user ID |
item_id | the item ID |
Implements Recommender.
|
inlineprotectedvirtual |
Predict the specified user_id, item_id, day and bin
Assumes user and item IDs are valid.
user_id | the user ID |
item_id | the item ID |
day | the day of the rating |
bin | the day bin of the rating |
Reimplemented in TimeAwareBaselineWithFrequencies.
|
inlinevirtual |
predict rating at a certain point in time
user_id | the user ID |
item_id | the item ID |
time | the time of the rating event |
Implements TimeAwareRatingPredictor.
Reimplemented in TimeAwareBaselineWithFrequencies.
|
inherited |
Recommend items for a given user
user_id | the user ID |
n | the number of items to recommend, -1 for as many as possible |
ignore_items | collection if items that should not be returned; if null, use empty collection |
candidate_items | the candidate items to choose from; if null, use all items |
Implemented in WeightedEnsemble, and Ensemble.
|
inlineprotected |
Given a DateTime object, return the day relative to the first rating day in the dataset
datetime | the date/time of the rating event |
|
inlinevirtualinherited |
Save the model parameters to a file
filename | the name of the file to write to |
Implements IRecommender.
Reimplemented in BPRMF, MatrixFactorization, BiasedMatrixFactorization, BPRSLIM, CoClustering, LeastSquareSLIM, SVDPlusPlus, UserItemBaseline, FactorWiseMatrixFactorization, BiPolarSlopeOne, SigmoidCombinedAsymmetricFactorModel, MF, NaiveBayes, SigmoidItemAsymmetricFactorModel, SigmoidUserAsymmetricFactorModel, SlopeOne, KNN, MostPopular, KNN, SLIM, MostPopularByAttributes, EntityAverage, ExternalItemRecommender, ExternalRatingPredictor, GlobalAverage, Constant, Random, Random, and Zero.
|
inline |
Return a string representation of the recommender
The ToString() method of recommenders should list the class name and all hyperparameters, separated by space characters.
Implements IRecommender.
|
inlinevirtual |
Learn the model parameters of the recommender from the training data
Implements Recommender.
Reimplemented in TimeAwareBaselineWithFrequencies.
|
inlineprotectedvirtual |
Single stochastic gradient descent step: update the parameter values for one user and one item
u | the user ID |
i | the item ID |
day | the day of the rating |
bin | the day bin of the rating |
err | the current error made for this rating |
Reimplemented in TimeAwareBaselineWithFrequencies.
|
protected |
last day in the training data, counting from the first day
|
protectedinherited |
Maximum rating value
|
protectedinherited |
Minimum rating value
|
protectedinherited |
rating data
|
protectedinherited |
rating data, including time information
|
getset |
learn rate for the user-wise alphas
|
getset |
beta parameter for modeling the drift in the user bias
|
getset |
bin size in days for modeling the time-dependent item bias
|
getset |
learn rate for the bin-wise item bias
|
getset |
learn rate for the item bias
|
getsetinherited |
Maximum item ID
|
getsetinherited |
Maximum rating value
|
getsetinherited |
Maximum user ID
|
getsetinherited |
Minimum rating value
|
getset |
number of iterations over the dataset to perform
|
getset |
regularization for the user-wise alphas
|
getset |
regularization for the item bias
|
getset |
regularization for the bin-wise item bias
|
getset |
regularization for the user bias
|
getset |
regularization for the day-wise user bias
|
getset |
regularization for the user scaling factor
|
getset |
regularization for the day-wise user scaling factor
|
getsetinherited |
the rating data, including time information
|
getset |
learn rate for the day-wise user bias
|
getset |
learn rate for the user bias
|
getset |
learn rate for the day-wise user scaling factor
|
getset |
learn rate for the user-wise scaling factor