public class AspectModelRecommender extends ProbabilisticGraphicalRecommender
This implementation refers to the method proposed by Thomas et al. at IJCAI 1999.
Tempered EM: Thomas Hofmann, Latent class models for collaborative filtering , IJCAI. 1999, 99: 688-693.
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,double[]> |
entryTopicDistribution
{user, item, {topic z, probability}}
|
protected int |
numTopics
number of topics
|
protected DenseMatrix |
topicItemProbs
Conditional distribution: P(i|z)
|
protected DenseMatrix |
topicItemProbsSum
Conditional distribution: P(i|z)
|
protected DenseVector |
topicProbs
topic distribution: P(z)
|
protected DenseVector |
topicProbsSum
topic distribution: P(z)
|
protected DenseMatrix |
topicUserProbs
Conditional distribution: P(u|z)
|
protected DenseMatrix |
topicUserProbsSum
Conditional distribution: P(u|z)
|
burnIn, numItems, numIterations, numStats, numUsers, sampleLag
conf, context, decay, earlyStop, globalMean, isBoldDriver, isRanking, itemMappingData, lastLoss, LOG, loss, maxRate, minRate, numRates, ratingScale, recommendedList, testMatrix, topN, trainMatrix, userMappingData, validMatrix, verbose
Constructor and Description |
---|
AspectModelRecommender() |
Modifier and Type | Method and Description |
---|---|
protected void |
eStep()
parameters estimation: used in the training phase
|
protected void |
mStep()
update the hyper-parameters
|
protected double |
predict(int userIdx,
int itemIdx)
predict a specific rating for user userIdx on item itemIdx, note that the
prediction is not bounded.
|
protected void |
setup()
setup
init member method
|
estimateParams, isConverged, readoutParams, trainModel
cleanup, evaluate, evaluateMap, getContext, getDataModel, getRecommendedList, loadModel, predict, recommend, recommend, recommendRank, recommendRating, saveModel, setContext
protected int numTopics
protected DenseMatrix topicUserProbs
protected DenseMatrix topicUserProbsSum
protected DenseMatrix topicItemProbs
protected DenseMatrix topicItemProbsSum
protected DenseVector topicProbs
protected DenseVector topicProbsSum
protected com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,double[]> entryTopicDistribution
protected void setup() throws LibrecException
ProbabilisticGraphicalRecommender
setup
in class ProbabilisticGraphicalRecommender
LibrecException
- if error occurs during setting upprotected void eStep()
ProbabilisticGraphicalRecommender
eStep
in class ProbabilisticGraphicalRecommender
protected void mStep()
ProbabilisticGraphicalRecommender
mStep
in class ProbabilisticGraphicalRecommender
protected double predict(int userIdx, int itemIdx) throws LibrecException
AbstractRecommender
predict
in class AbstractRecommender
userIdx
- user indexitemIdx
- item indexLibrecException
- if error occurs during predictingCopyright © 2017. All Rights Reserved.