org.mymedialite.itemrec
Class SoftMarginRankingMF
java.lang.Object
org.mymedialite.itemrec.ItemRecommender
org.mymedialite.itemrec.IncrementalItemRecommender
org.mymedialite.itemrec.MF
org.mymedialite.itemrec.BPRMF
org.mymedialite.itemrec.SoftMarginRankingMF
- All Implemented Interfaces:
- java.lang.Cloneable, IIterativeModel, IRecommender, IIncrementalItemRecommender
public class SoftMarginRankingMF
- extends BPRMF
Matrix Factorization model for item prediction optimized for a soft margin (hinge) ranking loss,
using stochastic gradient descent (as in BPR-MF).
Literature:
Steffen Rendle:
Context-Aware Ranking with Factorization Models.
Studies in Computational Intelligence. Springer 2011.
http://www.springer.com/engineering/computational+intelligence+and+complexity/book/978-3-642-16897-0
Markus Weimer, Alexandros Karatzoglou, Alex Smola:
Improving Maximum Margin Matrix Factorization.
Machine Learning Journal 2008.
Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, Lars Schmidt-Thieme:
BPR: Bayesian Personalized Ranking from Implicit Feedback.
UAI 2009.
http://www.ismll.uni-hildesheim.de/pub/pdfs/Rendle_et_al2009-Bayesian_Personalized_Ranking.pdf
This recommender supports incremental updates.
Fields inherited from class org.mymedialite.itemrec.BPRMF |
biasReg, boldDriver, fastSampling, fastSamplingMemoryLimit, itemBias, learnRate, random, regI, regJ, regU, uniformUserSampling, updateJ, userNegItems, userPosItems, withReplacement |
Method Summary |
double |
computeLoss()
Compute approximate loss. |
java.lang.String |
toString()
Return a string representation of the recommender |
protected void |
updateFactors(int u,
int i,
int j,
boolean update_u,
boolean update_i,
boolean update_j)
Update latent factors according to the stochastic gradient descent update rule. |
Methods inherited from class org.mymedialite.itemrec.BPRMF |
addFeedback, addItem, addUser, checkSampling, computeFit, createFastSamplingData, initModel, iterate, loadModel, loadModel, predict, removeFeedback, removeItem, removeUser, retrainItem, retrainUser, sampleItemPair, sampleOtherItem, sampleTriple, sampleUser, saveModel, saveModel, train, updateFactors |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SoftMarginRankingMF
public SoftMarginRankingMF()
updateFactors
protected void updateFactors(int u,
int i,
int j,
boolean update_u,
boolean update_i,
boolean update_j)
- Update latent factors according to the stochastic gradient descent update rule.
- Parameters:
u
- the user IDi
- the ID of the first itemj
- the ID of the second itemupdate_u
- if true, update the user latent factorsupdate_i
- if true, update the latent factors of the first itemupdate_j
- if true, update the latent factors of the second item
computeLoss
public double computeLoss()
- Compute approximate loss.
- Specified by:
computeLoss
in interface IIterativeModel
- Overrides:
computeLoss
in class BPRMF
- Returns:
- the approximate loss
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 BPRMF
- Returns:
- the class name and all hyperparameters, separated by space characters.