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.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_LEARNING_RATE |
static double |
DEFAULT_PREVENT_OVERFITTING |
static double |
DEFAULT_RANDOM_NOISE |
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
Factorization |
factorize() |
void |
refresh(Collection<Refreshable> alreadyRefreshed) |
protected void |
shufflePreferences() |
double |
train(int userIndex,
int itemIndex,
int feature,
double original,
double cachedEstimate) |
public static final double DEFAULT_LEARNING_RATE
public static final double DEFAULT_PREVENT_OVERFITTING
public static final double DEFAULT_RANDOM_NOISE
public ParallelArraysSGDFactorizer(DataModel dataModel, int numFeatures, int numIterations)
public ParallelArraysSGDFactorizer(DataModel dataModel, int numFeatures, int numIterations, double learningRate, double preventOverfitting, double randomNoise)
public ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePrefs, int numFeatures, int numIterations)
public ParallelArraysSGDFactorizer(FactorizablePreferences factorizablePreferences, int numFeatures, int numIterations, double learningRate, double preventOverfitting, double randomNoise)
public Factorization factorize() throws TasteException
factorize
in interface Factorizer
TasteException
public double train(int userIndex, int itemIndex, int feature, double original, double cachedEstimate)
protected void shufflePreferences()
public void refresh(Collection<Refreshable> alreadyRefreshed)
refresh
in interface Refreshable
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.