|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.ratingprediction.RatingPredictor
org.mymedialite.ratingprediction.TimeAwareRatingPredictor
org.mymedialite.ratingprediction.TimeAwareBaseline
public class TimeAwareBaseline
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: Yehuda Koren: The BellKor Solution to the Netflix Grand Prize This recommender does currently NOT support incremental updates.
Field Summary | |
---|---|
double |
alphaLearnRate
Learn rate for the user-wise alphas. |
double |
beta
Beta parameter for modeling the drift in the user bias. |
int |
binSize
Bin size in days for modeling the time-dependent item bias. |
double |
itemBiasByTimeBinLearnRate
Learn rate for the bin-wise item bias. |
double |
itemBiasLearnRate
Learn rate for the item bias. |
int |
numIter
Number of iterations over the dataset to perform. |
double |
regAlpha
Regularization for the user-wise alphas. |
double |
regI
Regularization for the item bias. |
double |
regItemBiasByTimeBin
Regularization for the bin-wise item bias. |
double |
regU
Regularization for the user bias. |
double |
regUserBiasByDay
Regularization for the day-wise user bias. |
double |
regUserScaling
Regularization for the user scaling factor. |
double |
regUserScalingByDay
Regularization for the day-wise user scaling factor. |
double |
userBiasByDayLearnRate
Learn rate for the day-wise user bias. |
double |
userBiasLearnRate
Learn rate for the user bias. |
double |
userScalingByDayLearnRate
Learn rate for the day-wise user scaling factor. |
double |
userScalingLearnRate
Learn rate for the user-wise scaling factor. |
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 | |
---|---|
TimeAwareBaseline()
Default constructor. |
Method Summary | |
---|---|
double |
computeLoss()
Compute the current loss of the model |
int |
getNumIter()
Get the number of iterations to run the training |
protected void |
initModel()
Initialize the model parameters. |
void |
iterate()
Run one iteration (= pass over the training data) |
void |
loadModel(java.lang.String filename)
Get the model parameters from a file |
double |
predict(int user_id,
int item_id)
Predict the rating or score for a given user-item combination. |
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. |
protected int |
relativeDay(java.util.Date date)
Given a Date object, return the day relative to the first rating day in the dataset. |
void |
saveModel(java.lang.String filename)
Save the model parameters to a file |
void |
setNumIter(int numIter)
Set the number of iterations to run the training |
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.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 |
---|
public int numIter
public int binSize
public double beta
public double userBiasLearnRate
public double itemBiasLearnRate
public double alphaLearnRate
public double itemBiasByTimeBinLearnRate
public double userBiasByDayLearnRate
public double userScalingLearnRate
public double userScalingByDayLearnRate
public double regU
public double regI
public double regAlpha
public double regItemBiasByTimeBin
public double regUserBiasByDay
public double regUserScaling
public double regUserScalingByDay
Constructor Detail |
---|
public TimeAwareBaseline()
Method Detail |
---|
public void setNumIter(int numIter)
IIterativeModel
setNumIter
in interface IIterativeModel
public int getNumIter()
IIterativeModel
getNumIter
in interface IIterativeModel
public void train()
IRecommender
train
in interface IRecommender
train
in class RatingPredictor
protected int relativeDay(java.util.Date date)
date
- the date/time of the rating event
protected void initModel()
public void iterate()
IIterativeModel
iterate
in interface IIterativeModel
protected void updateParameters(int u, int i, int day, int bin, double err)
public double predict(int user_id, int item_id)
IRecommender
predict
in interface IRecommender
predict
in class RatingPredictor
user_id
- the user IDitem_id
- the item ID
protected double predict(int user_id, int item_id, int day, int bin)
public double predict(int user_id, int item_id, java.util.Date time)
ITimeAwareRatingPredictor
predict
in interface ITimeAwareRatingPredictor
predict
in class TimeAwareRatingPredictor
user_id
- the user IDitem_id
- the item IDtime
- the time of the rating event
public double computeLoss()
IIterativeModel
computeLoss
in interface IIterativeModel
public java.lang.String toString()
IRecommender
toString
in interface IRecommender
toString
in class RatingPredictor
public void saveModel(java.lang.String filename) throws java.io.IOException
IRecommender
saveModel
in interface IRecommender
saveModel
in class RatingPredictor
filename
- the file to write to
java.io.IOException
public void loadModel(java.lang.String filename) throws java.io.IOException
IRecommender
loadModel
in interface IRecommender
loadModel
in class RatingPredictor
filename
- the file to read from
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |