## org.apache.mahout.math.hadoop.decomposer
Class DistributedLanczosSolver

    java.lang.Object
      org.apache.mahout.math.decomposer.lanczos.LanczosSolver
          org.apache.mahout.math.hadoop.decomposer.DistributedLanczosSolver

All Implemented Interfaces:
  org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

    public class DistributedLanczosSolver

extends LanczosSolver
implements org.apache.hadoop.util.Tool

Nested Class Summary
`class` `DistributedLanczosSolver.DistributedLanczosSolverJob` Inner subclass of AbstractJob so we get access to AbstractJob's functionality w.r.t.

Nested classes/interfaces inherited from class org.apache.mahout.math.decomposer.lanczos.LanczosSolver
`LanczosSolver.TimingSection`

Field Summary
`static java.lang.String` `RAW_EIGENVECTORS`

Fields inherited from class org.apache.mahout.math.decomposer.lanczos.LanczosSolver
`SAFE_MAX, scaleFactor`

Constructor Summary
`DistributedLanczosSolver()`

Method Summary
`org.apache.hadoop.conf.Configuration` `getConf()`
`protected Vector` `getInitialVector(VectorIterable corpus)` For the distributed case, the best guess at a useful initialization state for Lanczos we'll chose to be uniform over all input dimensions, L_2 normalized.
`DistributedLanczosSolver.DistributedLanczosSolverJob` `job()`
`static void` `main(java.lang.String[] args)`
`int` `run(org.apache.hadoop.fs.Path inputPath, org.apache.hadoop.fs.Path outputPath, org.apache.hadoop.fs.Path outputTmpPath, int numRows, int numCols, boolean isSymmetric, int desiredRank)` Run the solver to produce the raw eigenvectors
`int` `run(org.apache.hadoop.fs.Path inputPath, org.apache.hadoop.fs.Path outputPath, org.apache.hadoop.fs.Path outputTmpPath, int numRows, int numCols, boolean isSymmetric, int desiredRank, double maxError, double minEigenvalue, boolean inMemory)` Run the solver to produce raw eigenvectors, then run the EigenVerificationJob to clean them
`int` `run(java.lang.String[] strings)`
`void` `runJob(org.apache.hadoop.conf.Configuration originalConfig, org.apache.hadoop.fs.Path inputPath, org.apache.hadoop.fs.Path outputTmpPath, int numRows, int numCols, boolean isSymmetric, int desiredRank, Matrix eigenVectors, java.util.List<java.lang.Double> eigenValues, java.lang.String outputEigenVectorPathString)` Factored-out LanczosSolver for the purpose of invoking it programmatically
`void` `serializeOutput(Matrix eigenVectors, java.util.List<java.lang.Double> eigenValues, org.apache.hadoop.fs.Path outputPath)`
`void` `setConf(org.apache.hadoop.conf.Configuration configuration)`

Methods inherited from class org.apache.mahout.math.decomposer.lanczos.LanczosSolver
`calculateScaleFactor, getTimeMillis, solve, solve`

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

Field Detail

### RAW_EIGENVECTORS

    public static final java.lang.String RAW_EIGENVECTORS

See Also:
  Constant Field Values

Constructor Detail

### DistributedLanczosSolver

    public DistributedLanczosSolver()

Method Detail

### getInitialVector

    protected Vector getInitialVector(VectorIterable corpus)

  For the distributed case, the best guess at a useful initialization state for Lanczos we'll chose to be uniform over all input dimensions, L_2 normalized.

  Overrides:
    `getInitialVector` in class `LanczosSolver`

### runJob

    public void runJob(org.apache.hadoop.conf.Configuration originalConfig,
                       org.apache.hadoop.fs.Path inputPath,
                       org.apache.hadoop.fs.Path outputTmpPath,
                       int numRows,
                       int numCols,
                       boolean isSymmetric,
                       int desiredRank,
                       Matrix eigenVectors,
                       java.util.List<java.lang.Double> eigenValues,
                       java.lang.String outputEigenVectorPathString)
                throws java.io.IOException

  Factored-out LanczosSolver for the purpose of invoking it programmatically

  Throws:
    `java.io.IOException`

### run

    public int run(java.lang.String[] strings)
            throws java.lang.Exception

  Specified by:
    `run` in interface `org.apache.hadoop.util.Tool`
  Throws:
    `java.lang.Exception`

### run

    public int run(org.apache.hadoop.fs.Path inputPath,
                   org.apache.hadoop.fs.Path outputPath,
                   org.apache.hadoop.fs.Path outputTmpPath,
                   int numRows,
                   int numCols,
                   boolean isSymmetric,
                   int desiredRank,
                   double maxError,
                   double minEigenvalue,
                   boolean inMemory)
            throws java.lang.Exception

  Run the solver to produce raw eigenvectors, then run the EigenVerificationJob to clean them

  Parameters:
    `inputPath` - the Path to the input corpus
    `outputPath` - the Path to the output
    `outputTmpPath` - a Path to a temporary working directory
    `numRows` - the int number of rows
    `numCols` - the int number of columns
    `isSymmetric` - true if the input matrix is symmetric
    `desiredRank` - the int desired rank of eigenvectors to produce
    `maxError` - the maximum allowable error
    `minEigenvalue` - the minimum usable eigenvalue
    `inMemory` - true if the verification can be done in memory
  Returns:
    an int indicating success (0) or otherwise
  Throws:
    `java.lang.Exception`

### run

    public int run(org.apache.hadoop.fs.Path inputPath,
                   org.apache.hadoop.fs.Path outputPath,
                   org.apache.hadoop.fs.Path outputTmpPath,
                   int numRows,
                   int numCols,
                   boolean isSymmetric,
                   int desiredRank)
            throws java.lang.Exception

  Run the solver to produce the raw eigenvectors

  Parameters:
    `inputPath` - the Path to the input corpus
    `outputPath` - the Path to the output
    `outputTmpPath` - a Path to a temporary working directory
    `numRows` - the int number of rows
    `numCols` - the int number of columns
    `isSymmetric` - true if the input matrix is symmetric
    `desiredRank` - the int desired rank of eigenvectors to produce
  Returns:
    an int indicating success (0) or otherwise
  Throws:
    `java.lang.Exception`

### serializeOutput

    public void serializeOutput(Matrix eigenVectors,
                                java.util.List<java.lang.Double> eigenValues,
                                org.apache.hadoop.fs.Path outputPath)
                         throws java.io.IOException

  Parameters:
    `eigenVectors` - The eigenvectors to be serialized
    `eigenValues` - The eigenvalues to be serialized
    `outputPath` - The path (relative to the current Configuration's FileSystem) to save the output to.
  Throws:
    `java.io.IOException`

### setConf

    public void setConf(org.apache.hadoop.conf.Configuration configuration)

  Specified by:
    `setConf` in interface `org.apache.hadoop.conf.Configurable`

### getConf

    public org.apache.hadoop.conf.Configuration getConf()

  Specified by:
    `getConf` in interface `org.apache.hadoop.conf.Configurable`

### job

    public DistributedLanczosSolver.DistributedLanczosSolverJob job()

### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

  Throws:
    `java.lang.Exception`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.