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 int |
numTopics |
protected com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Double>> |
Q |
protected static double |
smallValue |
protected DenseMatrix |
topicItemProbs |
protected DenseMatrix |
topicItemProbsSum |
protected DenseVector |
topicProbs |
protected DenseVector |
topicProbsMean |
protected DenseVector |
topicProbsMeanSum |
protected DenseVector |
topicProbsSum |
protected DenseVector |
topicProbsVariance |
protected DenseVector |
topicProbsVarianceSum |
protected DenseMatrix |
topicUserProbs |
protected DenseMatrix |
topicUserProbsSum |
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 |
estimateParams()
estimate the model parameters
|
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 |
readoutParams()
read out parameters for each iteration
|
protected void |
setup()
setup
init member method
|
protected void |
trainModel()
train Model
|
isConverged
cleanup, evaluate, evaluateMap, getContext, getDataModel, getRecommendedList, loadModel, predict, recommend, recommend, recommendRank, recommendRating, saveModel, setContext
protected DenseMatrix topicUserProbs
protected DenseMatrix topicUserProbsSum
protected DenseMatrix topicItemProbs
protected DenseMatrix topicItemProbsSum
protected DenseVector topicProbs
protected DenseVector topicProbsSum
protected DenseVector topicProbsMean
protected DenseVector topicProbsMeanSum
protected DenseVector topicProbsVariance
protected DenseVector topicProbsVarianceSum
protected int numTopics
protected static double smallValue
protected com.google.common.collect.Table<java.lang.Integer,java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Double>> Q
protected void setup() throws LibrecException
ProbabilisticGraphicalRecommender
setup
in class ProbabilisticGraphicalRecommender
LibrecException
- if error occurs during setting upprotected void trainModel() throws LibrecException
AbstractRecommender
trainModel
in class ProbabilisticGraphicalRecommender
LibrecException
- if error occurs during training modelprotected void eStep()
ProbabilisticGraphicalRecommender
eStep
in class ProbabilisticGraphicalRecommender
protected void mStep()
ProbabilisticGraphicalRecommender
mStep
in class ProbabilisticGraphicalRecommender
protected void readoutParams()
ProbabilisticGraphicalRecommender
readoutParams
in class ProbabilisticGraphicalRecommender
protected void estimateParams()
ProbabilisticGraphicalRecommender
estimateParams
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.