org.apache.mahout.cf.taste.impl.recommender.svd
Class RatingSGDFactorizer

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.recommender.svd.AbstractFactorizer
      extended by org.apache.mahout.cf.taste.impl.recommender.svd.RatingSGDFactorizer
All Implemented Interfaces:
Refreshable, Factorizer
Direct Known Subclasses:
SVDPlusPlusFactorizer

public class RatingSGDFactorizer
extends AbstractFactorizer

Matrix factorization with user and item biases for rating prediction, trained with plain vanilla SGD


Field Summary
protected  double biasLearningRate
           
protected  double biasReg
           
protected  DataModel dataModel
           
protected static int FEATURE_OFFSET
           
protected static int ITEM_BIAS_INDEX
          place in item vector where the bias is stored
protected  double[][] itemVectors
          Item features
protected  double learningRate
          Learning rate (step size)
protected  double learningRateDecay
          Multiplicative decay factor for learning_rate
protected  int numFeatures
          Number of features used to compute this factorization
protected  double preventOverfitting
          Parameter used to prevent overfitting.
protected  double randomNoise
          Standard deviation for random initialization of features
protected static int USER_BIAS_INDEX
          place in user vector where the bias is stored
protected  double[][] userVectors
          User features
 
Constructor Summary
RatingSGDFactorizer(DataModel dataModel, int numFeatures, double learningRate, double preventOverfitting, double randomNoise, int numIterations, double learningRateDecay)
           
RatingSGDFactorizer(DataModel dataModel, int numFeatures, int numIterations)
           
 
Method Summary
 Factorization factorize()
           
protected  void prepareTraining()
           
protected  void shufflePreferences()
           
protected  void updateParameters(long userID, long itemID, float rating, double currentLearningRate)
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.recommender.svd.AbstractFactorizer
createFactorization, itemIndex, refresh, userIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_OFFSET

protected static final int FEATURE_OFFSET
See Also:
Constant Field Values

learningRateDecay

protected final double learningRateDecay
Multiplicative decay factor for learning_rate


learningRate

protected final double learningRate
Learning rate (step size)


preventOverfitting

protected final double preventOverfitting
Parameter used to prevent overfitting.


numFeatures

protected final int numFeatures
Number of features used to compute this factorization


randomNoise

protected final double randomNoise
Standard deviation for random initialization of features


userVectors

protected double[][] userVectors
User features


itemVectors

protected double[][] itemVectors
Item features


dataModel

protected final DataModel dataModel

biasLearningRate

protected double biasLearningRate

biasReg

protected double biasReg

USER_BIAS_INDEX

protected static final int USER_BIAS_INDEX
place in user vector where the bias is stored

See Also:
Constant Field Values

ITEM_BIAS_INDEX

protected static final int ITEM_BIAS_INDEX
place in item vector where the bias is stored

See Also:
Constant Field Values
Constructor Detail

RatingSGDFactorizer

public RatingSGDFactorizer(DataModel dataModel,
                           int numFeatures,
                           int numIterations)
                    throws TasteException
Throws:
TasteException

RatingSGDFactorizer

public RatingSGDFactorizer(DataModel dataModel,
                           int numFeatures,
                           double learningRate,
                           double preventOverfitting,
                           double randomNoise,
                           int numIterations,
                           double learningRateDecay)
                    throws TasteException
Throws:
TasteException
Method Detail

prepareTraining

protected void prepareTraining()
                        throws TasteException
Throws:
TasteException

shufflePreferences

protected void shufflePreferences()

factorize

public Factorization factorize()
                        throws TasteException
Throws:
TasteException

updateParameters

protected void updateParameters(long userID,
                                long itemID,
                                float rating,
                                double currentLearningRate)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.