## 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.

Field Summary
`static double` `DEFAULT_LEARNING_RATE`
`static double` `DEFAULT_PREVENT_OVERFITTING`
`static double` `DEFAULT_RANDOM_NOISE`

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)`

Method Summary
`Factorization` `factorize()`
`void` `refresh(Collection<Refreshable> alreadyRefreshed)`
`protected void` `shufflePreferences()`
`double` `train(int userIndex, int itemIndex, int feature, double original, double cachedEstimate)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### 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)

Method Detail

### 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.