TimeAwareBaselineWithFrequencies Class Reference

Time-aware bias model with frequencies. More...

Inheritance diagram for TimeAwareBaselineWithFrequencies:
TimeAwareBaseline TimeAwareRatingPredictor IIterativeModel RatingPredictor ITimeAwareRatingPredictor IRatingPredictor IRatingPredictor IRecommender IRecommender

List of all members.

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
override double ComputeFit ()
 Compute the fit (e.g. RMSE for rating prediction or AUC for item prediction/ranking) on the training data.
virtual void Iterate ()
 Run one iteration (= pass over the training data).
virtual void LoadModel (string file)
 Get the model parameters from a file.
override double Predict (int user_id, int item_id)
 Predict rating or score for a given user-item combination.
override double 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.
 TimeAwareBaselineWithFrequencies ()
 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

override void InitModel ()
 Initialize the model parameters.
override double 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.
override 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.

Protected Attributes

double max_rating
 Maximum rating value.
double min_rating
 Minimum rating value.
IRatings ratings
 rating data
ITimedRatings timed_ratings
 rating data, including time information

Properties

double AlphaLearnRate [get, set]
 learn rate for the user-wise alphas
double 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
double FrequencyLogBase [get, set]
 logarithmic base for the frequency counts
double ItemBiasAtFrequencyLearnRate [get, set]
 learn rate for b_{i, f_{ui}}
double ItemBiasByTimeBinLearnRate [get, set]
 learn rate for the bin-wise item bias
double ItemBiasLearnRate [get, set]
 learn rate for the item bias
int MaxItemID [get, set]
 Maximum item ID.
virtual double MaxRating [get, set]
 Maximum rating value.
int MaxUserID [get, set]
 Maximum user ID.
virtual double 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.
double RegAlpha [get, set]
 regularization for the user-wise alphas
double RegI [get, set]
 regularization for the item bias
double RegItemBiasAtFrequency [get, set]
 regularization constant for b_{i, f_{ui}}
double RegItemBiasByTimeBin [get, set]
 regularization for the bin-wise item bias
double RegU [get, set]
 regularization for the user bias
double RegUserBiasByDay [get, set]
 regularization for the day-wise user bias
double RegUserScaling [get, set]
 regularization for the user scaling factor
double RegUserScalingByDay [get, set]
 regularization for the day-wise user scaling factor
virtual ITimedRatings TimedRatings [get, set]
 the rating data, including time information
double UserBiasByDayLearnRate [get, set]
 learn rate for the day-wise user bias
double UserBiasLearnRate [get, set]
 learn rate for the user bias
double UserScalingByDayLearnRate [get, set]
 learn rate for the day-wise user scaling factor
double UserScalingLearnRate [get, set]
 learn rate for the user-wise scaling factor

Detailed Description

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:

This recommender does currently NOT support incremental updates.


Constructor & Destructor Documentation

Default constructor.


Member Function Documentation

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.

Parameters:
user_id the user ID
item_id the item ID
Returns:
true if a useful prediction can be made, false otherwise

Implements IRecommender.

Reimplemented in BiPolarSlopeOne, GlobalAverage, ItemAverage, SlopeOne, and UserAverage.

Object Clone (  )  [inline, inherited]

create a shallow copy of the object

override double ComputeFit (  )  [inline, virtual]

Compute the fit (e.g. RMSE for rating prediction or AUC for item prediction/ranking) on the training data.

Returns:
the fit on the training data according to the optimization criterion; -1 if not implemented

Reimplemented from TimeAwareBaseline.

override void InitModel (  )  [inline, protected, virtual]

Initialize the model parameters.

Reimplemented from TimeAwareBaseline.

virtual void Iterate (  )  [inline, virtual, inherited]

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.

Parameters:
filename the name of the file to read from

Implements IRecommender.

Reimplemented in BiasedMatrixFactorization, BiPolarSlopeOne, CoClustering, EntityAverage, FactorWiseMatrixFactorization, GlobalAverage, ItemKNN, KNN, MatrixFactorization, SlopeOne, and UserItemBaseline.

override double Predict ( int  user_id,
int  item_id 
) [inline, virtual, inherited]

Predict rating or score for a given user-item combination.

Parameters:
user_id the user ID
item_id the item ID
Returns:
the predicted score/rating for the given user-item combination

Implements RatingPredictor.

override double Predict ( int  user_id,
int  item_id,
DateTime  time 
) [inline, virtual]

predict rating at a certain point in time

Parameters:
user_id the user ID
item_id the item ID
time the time of the rating event

Reimplemented from TimeAwareBaseline.

override double 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.

Parameters:
user_id the user ID
item_id the item ID
day the day of the rating
bin the day bin of the rating

Reimplemented from TimeAwareBaseline.

int RelativeDay ( DateTime  datetime  )  [inline, protected, inherited]

Given a DateTime object, return the day relative to the first rating day in the dataset.

Returns:
the day relative to the first rating day in the dataset
Parameters:
datetime the date/time of the rating event
virtual void SaveModel ( string  filename  )  [inline, virtual, inherited]

Save the model parameters to a file.

Parameters:
filename the name of the file to write to

Implements IRecommender.

Reimplemented in BiasedMatrixFactorization, BiPolarSlopeOne, CoClustering, EntityAverage, FactorWiseMatrixFactorization, GlobalAverage, KNN, MatrixFactorization, SlopeOne, and UserItemBaseline.

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 TimeAwareBaseline.

override void UpdateParameters ( int  u,
int  i,
int  day,
int  bin,
double  err 
) [inline, protected, virtual]

Single SGD step: update the parameter values for one user and one item.

Parameters:
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 from TimeAwareBaseline.


Member Data Documentation

double max_rating [protected, inherited]

Maximum rating value.

double min_rating [protected, inherited]

Minimum rating value.

IRatings ratings [protected, inherited]

rating data

ITimedRatings timed_ratings [protected, inherited]

rating data, including time information


Property Documentation

double AlphaLearnRate [get, set, inherited]

learn rate for the user-wise alphas

double Beta [get, set, inherited]

beta parameter for modeling the drift in the user bias

int BinSize [get, set, inherited]

bin size in days for modeling the time-dependent item bias

double FrequencyLogBase [get, set]

logarithmic base for the frequency counts

double ItemBiasAtFrequencyLearnRate [get, set]

learn rate for b_{i, f_{ui}}

double ItemBiasByTimeBinLearnRate [get, set, inherited]

learn rate for the bin-wise item bias

double ItemBiasLearnRate [get, set, inherited]

learn rate for the item bias

int MaxItemID [get, set, inherited]

Maximum item ID.

virtual double MaxRating [get, set, inherited]

Maximum rating value.

Implements IRatingPredictor.

int MaxUserID [get, set, inherited]

Maximum user ID.

virtual double MinRating [get, set, inherited]

Minimum rating value.

Implements IRatingPredictor.

uint NumIter [get, set, inherited]

number of iterations over the dataset to perform

Implements IIterativeModel.

override IRatings Ratings [get, set, inherited]

The rating data.

Reimplemented from RatingPredictor.

double RegAlpha [get, set, inherited]

regularization for the user-wise alphas

double RegI [get, set, inherited]

regularization for the item bias

double RegItemBiasAtFrequency [get, set]

regularization constant for b_{i, f_{ui}}

double RegItemBiasByTimeBin [get, set, inherited]

regularization for the bin-wise item bias

double RegU [get, set, inherited]

regularization for the user bias

double RegUserBiasByDay [get, set, inherited]

regularization for the day-wise user bias

double RegUserScaling [get, set, inherited]

regularization for the user scaling factor

double RegUserScalingByDay [get, set, inherited]

regularization for the day-wise user scaling factor

virtual ITimedRatings TimedRatings [get, set, inherited]

the rating data, including time information

Implements ITimeAwareRatingPredictor.

double UserBiasByDayLearnRate [get, set, inherited]

learn rate for the day-wise user bias

double UserBiasLearnRate [get, set, inherited]

learn rate for the user bias

double UserScalingByDayLearnRate [get, set, inherited]

learn rate for the day-wise user scaling factor

double UserScalingLearnRate [get, set, inherited]

learn rate for the user-wise scaling factor


The documentation for this class was generated from the following file:
Generated on Mon Nov 28 19:18:50 2011 for MyMediaLite by  doxygen 1.6.3