|
MyMediaLite
3.02
|
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. | |
| Object | Clone () |
| create a shallow copy of the object | |
| virtual float | ComputeObjective () |
| Compute the current optimization objective (usually loss plus regularization term) of the model. | |
| virtual void | Iterate () |
| Run one iteration (= pass over the training data) | |
| virtual void | LoadModel (string file) |
| Get the model parameters from a file. | |
| override float | Predict (int user_id, int item_id) |
| Predict rating or score for a given user-item combination. | |
| override float | Predict (int user_id, int item_id, DateTime time) |
| predict rating at a certain point in time | |
| virtual void | SaveModel (string file) |
| Save the model parameters to a file. | |
| TimeAwareBaseline () | |
| default constructor | |
| override string | ToString () |
| Return a string representation of the recommender. | |
| override void | Train () |
| Learn the model parameters of the recommender from the training data. | |
Protected Member Functions | |
| virtual void | InitModel () |
| Initialize the model parameters. | |
| virtual float | Predict (int user_id, int item_id, int day, int bin) |
| Predict the specified user_id, item_id, day and bin. | |
| int | RelativeDay (DateTime datetime) |
| Given a DateTime object, return the day relative to the first rating day in the dataset. | |
| 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. | |
Protected Attributes | |
| int | latest_relative_day |
| last day in the training data, counting from the first day | |
| float | max_rating |
| Maximum rating value. | |
| float | min_rating |
| Minimum rating value. | |
| IRatings | ratings |
| rating data | |
| ITimedRatings | timed_ratings |
| rating data, including time information | |
Properties | |
| float | AlphaLearnRate [get, set] |
| learn rate for the user-wise alphas | |
| float | Beta [get, set] |
| beta parameter for modeling the drift in the user bias | |
| int | BinSize [get, set] |
| bin size in days for modeling the time-dependent item bias | |
| float | ItemBiasByTimeBinLearnRate [get, set] |
| learn rate for the bin-wise item bias | |
| float | ItemBiasLearnRate [get, set] |
| learn rate for the item bias | |
| int | MaxItemID [get, set] |
| Maximum item ID. | |
| virtual float | MaxRating [get, set] |
| Maximum rating value. | |
| int | MaxUserID [get, set] |
| Maximum user ID. | |
| virtual float | MinRating [get, set] |
| Minimum rating value. | |
| uint | NumIter [get, set] |
| number of iterations over the dataset to perform | |
| override IRatings | Ratings [get, set] |
| The rating data. | |
| float | RegAlpha [get, set] |
| regularization for the user-wise alphas | |
| float | RegI [get, set] |
| regularization for the item bias | |
| float | RegItemBiasByTimeBin [get, set] |
| regularization for the bin-wise item bias | |
| float | RegU [get, set] |
| regularization for the user bias | |
| float | RegUserBiasByDay [get, set] |
| regularization for the day-wise user bias | |
| float | RegUserScaling [get, set] |
| regularization for the user scaling factor | |
| float | RegUserScalingByDay [get, set] |
| regularization for the day-wise user scaling factor | |
| virtual ITimedRatings | TimedRatings [get, set] |
| the rating data, including time information | |
| float | UserBiasByDayLearnRate [get, set] |
| learn rate for the day-wise user bias | |
| float | UserBiasLearnRate [get, set] |
| learn rate for the user bias | |
| float | UserScalingByDayLearnRate [get, set] |
| learn rate for the day-wise user scaling factor | |
| float | UserScalingLearnRate [get, set] |
| learn rate for the user-wise scaling factor | |
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.
| TimeAwareBaseline | ( | ) | [inline] |
default constructor
| virtual bool CanPredict | ( | int | user_id, |
| int | item_id | ||
| ) | [inline, virtual, inherited] |
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 BiPolarSlopeOne, Constant, SlopeOne, GlobalAverage, UserAverage, ItemAverage, and Random.
| Object Clone | ( | ) | [inline, inherited] |
create a shallow copy of the object
| virtual float ComputeObjective | ( | ) | [inline, virtual] |
Compute the current optimization objective (usually loss plus regularization term) of the model.
Implements IIterativeModel.
Reimplemented in TimeAwareBaselineWithFrequencies.
| virtual void InitModel | ( | ) | [inline, protected, virtual] |
Initialize the model parameters.
Reimplemented in TimeAwareBaselineWithFrequencies.
| virtual void Iterate | ( | ) | [inline, virtual] |
Run one iteration (= pass over the training data)
Implements IIterativeModel.
| virtual void LoadModel | ( | string | filename | ) | [inline, virtual, inherited] |
Get the model parameters from a file.
| filename | the name of the file to read from |
Implements IRecommender.
Reimplemented in MatrixFactorization, BiasedMatrixFactorization, CoClustering, SVDPlusPlus, FactorWiseMatrixFactorization, UserItemBaseline, SigmoidCombinedAsymmetricFactorModel, SigmoidSVDPlusPlus, BiPolarSlopeOne, SigmoidItemAsymmetricFactorModel, SigmoidUserAsymmetricFactorModel, ItemKNN, NaiveBayes, SlopeOne, EntityAverage, KNN, GlobalAverage, Constant, and Random.
| override float Predict | ( | int | user_id, |
| int | item_id | ||
| ) | [inline, virtual] |
Predict rating or score for a given user-item combination.
| user_id | the user ID |
| item_id | the item ID |
Implements RatingPredictor.
| virtual float Predict | ( | int | user_id, |
| int | item_id, | ||
| int | day, | ||
| int | bin | ||
| ) | [inline, protected, virtual] |
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.
| override float Predict | ( | int | user_id, |
| int | item_id, | ||
| DateTime | time | ||
| ) | [inline, virtual] |
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.
| int RelativeDay | ( | DateTime | datetime | ) | [inline, protected] |
Given a DateTime object, return the day relative to the first rating day in the dataset.
| datetime | the date/time of the rating event |
| virtual void SaveModel | ( | string | filename | ) | [inline, virtual, inherited] |
Save the model parameters to a file.
| filename | the name of the file to write to |
Implements IRecommender.
Reimplemented in MatrixFactorization, BiasedMatrixFactorization, CoClustering, SVDPlusPlus, FactorWiseMatrixFactorization, UserItemBaseline, BiPolarSlopeOne, SigmoidCombinedAsymmetricFactorModel, NaiveBayes, SigmoidItemAsymmetricFactorModel, SigmoidUserAsymmetricFactorModel, SlopeOne, EntityAverage, KNN, GlobalAverage, Constant, and Random.
| override string ToString | ( | ) | [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.
Reimplemented from RatingPredictor.
Reimplemented in TimeAwareBaselineWithFrequencies.
| virtual void UpdateParameters | ( | int | u, |
| int | i, | ||
| int | day, | ||
| int | bin, | ||
| float | err | ||
| ) | [inline, protected, virtual] |
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.
int latest_relative_day [protected] |
last day in the training data, counting from the first day
float max_rating [protected, inherited] |
Maximum rating value.
float min_rating [protected, inherited] |
Minimum rating value.
ITimedRatings timed_ratings [protected, inherited] |
rating data, including time information
float AlphaLearnRate [get, set] |
learn rate for the user-wise alphas
float Beta [get, set] |
beta parameter for modeling the drift in the user bias
int BinSize [get, set] |
bin size in days for modeling the time-dependent item bias
float ItemBiasByTimeBinLearnRate [get, set] |
learn rate for the bin-wise item bias
float ItemBiasLearnRate [get, set] |
learn rate for the item bias
int MaxItemID [get, set, inherited] |
Maximum item ID.
virtual float MaxRating [get, set, inherited] |
Maximum rating value.
Implements IRatingPredictor.
int MaxUserID [get, set, inherited] |
Maximum user ID.
virtual float MinRating [get, set, inherited] |
Minimum rating value.
Implements IRatingPredictor.
uint NumIter [get, set] |
number of iterations over the dataset to perform
Implements IIterativeModel.
The rating data.
Reimplemented from RatingPredictor.
float RegAlpha [get, set] |
regularization for the user-wise alphas
float RegI [get, set] |
regularization for the item bias
float RegItemBiasByTimeBin [get, set] |
regularization for the bin-wise item bias
float RegU [get, set] |
regularization for the user bias
float RegUserBiasByDay [get, set] |
regularization for the day-wise user bias
float RegUserScaling [get, set] |
regularization for the user scaling factor
float RegUserScalingByDay [get, set] |
regularization for the day-wise user scaling factor
virtual ITimedRatings TimedRatings [get, set, inherited] |
the rating data, including time information
Implements ITimeAwareRatingPredictor.
float UserBiasByDayLearnRate [get, set] |
learn rate for the day-wise user bias
float UserBiasLearnRate [get, set] |
learn rate for the user bias
float UserScalingByDayLearnRate [get, set] |
learn rate for the day-wise user scaling factor
float UserScalingLearnRate [get, set] |
learn rate for the user-wise scaling factor
1.7.6.1