org.apache.mahout.math.hadoop.solver
Class DistributedConjugateGradientSolver
java.lang.Object
org.apache.mahout.math.solver.ConjugateGradientSolver
org.apache.mahout.math.hadoop.solver.DistributedConjugateGradientSolver
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool
public class DistributedConjugateGradientSolver
- extends ConjugateGradientSolver
- implements org.apache.hadoop.util.Tool
Distributed implementation of the conjugate gradient solver. More or less, this is just the standard solver
but wrapped with some methods that make it easy to run it on a DistributedRowMatrix.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedConjugateGradientSolver
public DistributedConjugateGradientSolver()
runJob
public Vector runJob(org.apache.hadoop.fs.Path inputPath,
org.apache.hadoop.fs.Path tempPath,
int numRows,
int numCols,
Vector b,
Preconditioner preconditioner,
int maxIterations,
double maxError)
- Runs the distributed conjugate gradient solver programmatically to solve the system (A + lambda*I)x = b.
- Parameters:
inputPath
- Path to the matrix AtempPath
- Path to scratch output path, deleted after the solver completesnumRows
- Number of rows in AnumCols
- Number of columns in Ab
- Vector bpreconditioner
- Optional preconditioner for the systemmaxIterations
- Maximum number of iterations to run, defaults to numColsmaxError
- Maximum error tolerated in the result. If the norm of the residual falls below this,
then the algorithm stops and returns.
- Returns:
- The vector that solves the system.
getConf
public org.apache.hadoop.conf.Configuration getConf()
- Specified by:
getConf
in interface org.apache.hadoop.conf.Configurable
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
- Specified by:
setConf
in interface org.apache.hadoop.conf.Configurable
run
public int run(String[] strings)
throws Exception
- Specified by:
run
in interface org.apache.hadoop.util.Tool
- Throws:
Exception
job
public DistributedConjugateGradientSolver.DistributedConjugateGradientSolverJob job()
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.