org.apache.mahout.cf.taste.example.kddcup.track1.svd
Class ParallelArraysSGDFactorizer
java.lang.Object
org.apache.mahout.cf.taste.example.kddcup.track1.svd.ParallelArraysSGDFactorizer
- All Implemented Interfaces:
- Refreshable, Factorizer
public class ParallelArraysSGDFactorizer
- extends Object
- implements Factorizer
Factorizer
based on Simon Funk's famous article
"Netflix Update: Try this at home".
Attempts to be as memory efficient as possible, only iterating once through the
FactorizablePreferences
or DataModel
while copying everything to primitive arrays.
Learning works in place on these datastructures after that.
Constructor Summary |
ParallelArraysSGDFactorizer(DataModel dataModel,
int numFeatures,
int numIterations)
|
ParallelArraysSGDFactorizer(DataModel dataModel,
int numFeatures,
int numIterations,
double learningRate,
double preventOverfitting,
double randomNoise)
|
ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePrefs,
int numFeatures,
int numIterations)
|
ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePreferences,
int numFeatures,
int numIterations,
double learningRate,
double preventOverfitting,
double randomNoise)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LEARNING_RATE
public static final double DEFAULT_LEARNING_RATE
- See Also:
- Constant Field Values
DEFAULT_PREVENT_OVERFITTING
public static final double DEFAULT_PREVENT_OVERFITTING
- See Also:
- Constant Field Values
DEFAULT_RANDOM_NOISE
public static final double DEFAULT_RANDOM_NOISE
- See Also:
- Constant Field Values
ParallelArraysSGDFactorizer
public ParallelArraysSGDFactorizer(DataModel dataModel,
int numFeatures,
int numIterations)
ParallelArraysSGDFactorizer
public ParallelArraysSGDFactorizer(DataModel dataModel,
int numFeatures,
int numIterations,
double learningRate,
double preventOverfitting,
double randomNoise)
ParallelArraysSGDFactorizer
public ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePrefs,
int numFeatures,
int numIterations)
ParallelArraysSGDFactorizer
public ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePreferences,
int numFeatures,
int numIterations,
double learningRate,
double preventOverfitting,
double randomNoise)
factorize
public Factorization factorize()
throws TasteException
- Specified by:
factorize
in interface Factorizer
- Throws:
TasteException
train
public double train(int userIndex,
int itemIndex,
int feature,
double original,
double cachedEstimate)
shufflePreferences
protected void shufflePreferences()
refresh
public void refresh(Collection<Refreshable> alreadyRefreshed)
- Specified by:
refresh
in interface Refreshable
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.