org.mymedialite.ratingprediction
Class TimeAwareBaselineWithFrequencies

java.lang.Object
  extended by org.mymedialite.ratingprediction.RatingPredictor
      extended by org.mymedialite.ratingprediction.TimeAwareRatingPredictor
          extended by org.mymedialite.ratingprediction.TimeAwareBaseline
              extended by org.mymedialite.ratingprediction.TimeAwareBaselineWithFrequencies
All Implemented Interfaces:
java.lang.Cloneable, IIterativeModel, IRecommender, IRatingPredictor, ITimeAwareRatingPredictor

public class TimeAwareBaselineWithFrequencies
extends TimeAwareBaseline

Time-aware bias model with frequencies. Model described in equation (11) of BellKor Grand Prize documentation for the Netflix Prize (see below). 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: Yehuda Koren: The BellKor Solution to the Netflix Grand Prize This recommender does currently NOT support incremental updates.


Field Summary
 double FrequencyLogBase
          logarithmic base for the frequency counts.
 double ItemBiasAtFrequencyLearnRate
          Learn rate for b_{i, f_{ui}}.
 double RegItemBiasAtFrequency
          Regularization constant for b_{i, f_{ui}}.
 
Fields inherited from class org.mymedialite.ratingprediction.TimeAwareBaseline
alphaLearnRate, beta, binSize, itemBiasByTimeBinLearnRate, itemBiasLearnRate, numIter, regAlpha, regI, regItemBiasByTimeBin, regU, regUserBiasByDay, regUserScaling, regUserScalingByDay, userBiasByDayLearnRate, userBiasLearnRate, userScalingByDayLearnRate, userScalingLearnRate
 
Fields inherited from class org.mymedialite.ratingprediction.TimeAwareRatingPredictor
timed_ratings
 
Fields inherited from class org.mymedialite.ratingprediction.RatingPredictor
maxItemID, maxRating, maxUserID, minRating, ratings
 
Constructor Summary
TimeAwareBaselineWithFrequencies()
          Default constructor.
 
Method Summary
 double computeLoss()
          Compute the current loss of the model
protected  void initModel()
          Initialize the model parameters.
 double predict(int user_id, int item_id, java.util.Date time)
          predict rating at a certain point in time.
protected  double predict(int user_id, int item_id, int day, int bin)
          Predict the specified user_id, item_id, day and bin.
 java.lang.String toString()
          Return a string representation of the recommender
 void train()
          Learn the model parameters of the recommender from the training data
protected  void updateParameters(int u, int i, int day, int bin, double err)
          Single SGD step: update the parameter values for one user and one item.
 
Methods inherited from class org.mymedialite.ratingprediction.TimeAwareBaseline
getNumIter, iterate, loadModel, predict, relativeDay, saveModel, setNumIter
 
Methods inherited from class org.mymedialite.ratingprediction.TimeAwareRatingPredictor
getRatings, getTimedRatings, setRatings, setTimedRatings
 
Methods inherited from class org.mymedialite.ratingprediction.RatingPredictor
canPredict, clone, getMaxRating, getMinRating, setMaxRating, setMinRating
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mymedialite.ratingprediction.IRatingPredictor
getMaxRating, getMinRating, setMaxRating, setMinRating
 
Methods inherited from interface org.mymedialite.IRecommender
canPredict
 

Field Detail

FrequencyLogBase

public double FrequencyLogBase
logarithmic base for the frequency counts.


RegItemBiasAtFrequency

public double RegItemBiasAtFrequency
Regularization constant for b_{i, f_{ui}}.


ItemBiasAtFrequencyLearnRate

public double ItemBiasAtFrequencyLearnRate
Learn rate for b_{i, f_{ui}}.

Constructor Detail

TimeAwareBaselineWithFrequencies

public TimeAwareBaselineWithFrequencies()
Default constructor.

Method Detail

train

public void train()
Description copied from interface: IRecommender
Learn the model parameters of the recommender from the training data

Specified by:
train in interface IRecommender
Overrides:
train in class TimeAwareBaseline

initModel

protected void initModel()
Description copied from class: TimeAwareBaseline
Initialize the model parameters.

Overrides:
initModel in class TimeAwareBaseline

updateParameters

protected void updateParameters(int u,
                                int i,
                                int day,
                                int bin,
                                double err)
Description copied from class: TimeAwareBaseline
Single SGD step: update the parameter values for one user and one item. the user ID the item ID the day of the rating the day bin of the rating the current error made for this rating

Overrides:
updateParameters in class TimeAwareBaseline

predict

protected double predict(int user_id,
                         int item_id,
                         int day,
                         int bin)
Description copied from class: TimeAwareBaseline
Predict the specified user_id, item_id, day and bin. Assumes user and item IDs are valid. the user ID the item ID the day of the rating the day bin of the rating

Overrides:
predict in class TimeAwareBaseline

predict

public double predict(int user_id,
                      int item_id,
                      java.util.Date time)
Description copied from interface: ITimeAwareRatingPredictor
predict rating at a certain point in time.

Specified by:
predict in interface ITimeAwareRatingPredictor
Overrides:
predict in class TimeAwareBaseline
Parameters:
user_id - the user ID
item_id - the item ID
time - the time of the rating event
Returns:
the prediction value

computeLoss

public double computeLoss()
Description copied from interface: IIterativeModel
Compute the current loss of the model

Specified by:
computeLoss in interface IIterativeModel
Overrides:
computeLoss in class TimeAwareBaseline
Returns:
the current loss; -1 if not implemented

toString

public java.lang.String toString()
Description copied from interface: IRecommender
Return a string representation of the recommender

Specified by:
toString in interface IRecommender
Overrides:
toString in class TimeAwareBaseline
Returns:
the class name and all hyperparameters, separated by space characters.