org.apache.mahout.math.hadoop.decomposer
Class EigenVerificationJob

java.lang.Object
  extended by org.apache.mahout.cf.taste.hadoop.AbstractJob
      extended by org.apache.mahout.math.hadoop.decomposer.EigenVerificationJob
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class EigenVerificationJob
extends AbstractJob

Class for taking the output of an eigendecomposition (specified as a Path location), and verifies correctness, in terms of the following: if you have a vector e, and a matrix m, then let e' = m.timesSquared(v); the error w.r.t. eigenvector-ness is the cosine of the angle between e and e':

   error(e,e') = e.dot(e') / (e.norm(2)*e'.norm(2))
 

A set of eigenvectors should also all be very close to orthogonal, so this job computes all inner products between eigenvectors, and checks that this is close to the identity matrix.

Parameters used in the cleanup (other than in the input/output path options) include --minEigenvalue, which specifies the value below which eigenvector/eigenvalue pairs will be discarded, and --maxError, which specifies the maximum error (as defined above) to be tolerated in an eigenvector.

If all the eigenvectors can fit in memory, --inMemory allows for a speedier completion of this task by doing so.


Constructor Summary
EigenVerificationJob()
           
 
Method Summary
 VectorIterable computePairwiseInnerProducts()
           
 java.util.Map<java.lang.String,java.lang.String> handleArgs(java.lang.String[] args)
           
static void main(java.lang.String[] args)
           
 java.util.List<java.util.Map.Entry<MatrixSlice,EigenStatus>> pruneEigens(java.util.Map<MatrixSlice,EigenStatus> eigenMetaData)
           
 int run(java.lang.String[] args)
           
 void saveCleanEigens(java.util.List<java.util.Map.Entry<MatrixSlice,EigenStatus>> prunedEigenMeta)
           
 void setEigensToVerify(VectorIterable eigens)
           
 java.util.Map<MatrixSlice,EigenStatus> verifyEigens()
           
 
Methods inherited from class org.apache.mahout.cf.taste.hadoop.AbstractJob
buildOption, buildOption, getConf, maybePut, parseArguments, prepareJobConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EigenVerificationJob

public EigenVerificationJob()
Method Detail

setEigensToVerify

public void setEigensToVerify(VectorIterable eigens)

run

public int run(java.lang.String[] args)
        throws java.lang.Exception
Throws:
java.lang.Exception

handleArgs

public java.util.Map<java.lang.String,java.lang.String> handleArgs(java.lang.String[] args)

computePairwiseInnerProducts

public VectorIterable computePairwiseInnerProducts()

saveCleanEigens

public void saveCleanEigens(java.util.List<java.util.Map.Entry<MatrixSlice,EigenStatus>> prunedEigenMeta)
                     throws java.io.IOException
Throws:
java.io.IOException

pruneEigens

public java.util.List<java.util.Map.Entry<MatrixSlice,EigenStatus>> pruneEigens(java.util.Map<MatrixSlice,EigenStatus> eigenMetaData)

verifyEigens

public java.util.Map<MatrixSlice,EigenStatus> verifyEigens()

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.