public abstract class SocialRecommender extends MatrixFactorizationRecommender
Modifier and Type | Field and Description |
---|---|
protected float |
regSocial
social regularization
|
protected SparseMatrix |
socialMatrix
socialMatrix: social rate matrix, indicating a user is connecting to a number of other users
|
initMean, initStd, itemFactors, learnRate, maxLearnRate, numFactors, numIterations, regItem, regUser, userFactors
conf, context, decay, earlyStop, globalMean, isBoldDriver, isRanking, itemMappingData, lastLoss, LOG, loss, maxRate, minRate, numItems, numRates, numUsers, ratingScale, recommendedList, testMatrix, topN, trainMatrix, userMappingData, validMatrix, verbose
Constructor and Description |
---|
SocialRecommender() |
Modifier and Type | Method and Description |
---|---|
protected double |
denormalize(double predictRating)
denormalize a prediction to the region (minRate, maxRate)
|
protected double |
normalize(double rating)
normalize a rating to the region (0, 1)
|
protected double |
predict(int userIdx,
int itemIdx,
boolean bounded)
predict a specific rating for user userIdx on item itemIdx.
|
void |
setup()
setup
init member method
|
predict, updateLRate
cleanup, evaluate, evaluateMap, getContext, getDataModel, getRecommendedList, isConverged, loadModel, recommend, recommend, recommendRank, recommendRating, saveModel, setContext, trainModel
protected SparseMatrix socialMatrix
protected float regSocial
public void setup() throws LibrecException
MatrixFactorizationRecommender
setup
in class MatrixFactorizationRecommender
LibrecException
- if error occurs during setting upprotected double predict(int userIdx, int itemIdx, boolean bounded) throws LibrecException
AbstractRecommender
predict
in class AbstractRecommender
userIdx
- user indexitemIdx
- item indexbounded
- whether there is a boundLibrecException
- if error occurs during predictingprotected double denormalize(double predictRating)
predictRating
- a prediction to the region (minRate, maxRate)protected double normalize(double rating)
rating
- a given ratingCopyright © 2017. All Rights Reserved.