org.mymedialite.ratingprediction
Class LogisticRegressionMatrixFactorization
java.lang.Object
org.mymedialite.ratingprediction.RatingPredictor
org.mymedialite.ratingprediction.IncrementalRatingPredictor
org.mymedialite.ratingprediction.MatrixFactorization
org.mymedialite.ratingprediction.BiasedMatrixFactorization
org.mymedialite.ratingprediction.LogisticRegressionMatrixFactorization
- All Implemented Interfaces:
- java.lang.Cloneable, IIterativeModel, IRecommender, IIncrementalRatingPredictor, IRatingPredictor
public class LogisticRegressionMatrixFactorization
- extends BiasedMatrixFactorization
Matrix factorization with explicit user and item bias, learning is performed by
stochastic gradient descent, optimized for the log likelihood.
Implements a simple version Menon and Elkan's LFL model:
Predicts binary labels, no advanced regUlarization, no side information.
Literature:
Aditya Krishna Menon, Charles Elkan:
A log-linear model with latent features for dyadic prediction.
ICDM 2010.
http://cseweb.ucsd.edu/~akmenon/LFL-ICDM10.pdf
This recommender supports incremental updates.
Method Summary |
double |
computeLoss()
Compute the regularized loss. |
protected void |
iterate(java.util.List<java.lang.Integer> rating_indices,
boolean update_user,
boolean update_item)
Iterate once over rating data and adjust corresponding factors (stochastic gradient descent). |
java.lang.String |
toString()
Return a string representation of the recommender |
Methods inherited from class org.mymedialite.ratingprediction.BiasedMatrixFactorization |
addItem, addUser, initModel, iterate, iterateRMSE, loadModel, predict, removeItem, removeUser, retrainItem, retrainUser, saveModel, setRegularization, train |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LogisticRegressionMatrixFactorization
public LogisticRegressionMatrixFactorization()
iterate
protected void iterate(java.util.List<java.lang.Integer> rating_indices,
boolean update_user,
boolean update_item)
- Description copied from class:
MatrixFactorization
- Iterate once over rating data and adjust corresponding factors (stochastic gradient descent).
- Overrides:
iterate
in class BiasedMatrixFactorization
- Parameters:
rating_indices
- a list of indices pointing to the ratings to iterate overupdate_user
- true if user factors to be updatedupdate_item
- true if item factors to be updated
computeLoss
public double computeLoss()
- Description copied from class:
MatrixFactorization
- Compute the regularized loss.
- Specified by:
computeLoss
in interface IIterativeModel
- Overrides:
computeLoss
in class MatrixFactorization
- Returns:
- the regularized loss
toString
public java.lang.String toString()
- Description copied from class:
BiasedMatrixFactorization
- Return a string representation of the recommender
- Specified by:
toString
in interface IRecommender
- Overrides:
toString
in class BiasedMatrixFactorization
- Returns:
- the class name and all hyperparameters, separated by space characters.