Example usage for org.apache.mahout.math.hadoop MatrixMultiplicationJob createMatrixMultiplyJobConf

List of usage examples for org.apache.mahout.math.hadoop MatrixMultiplicationJob createMatrixMultiplyJobConf

Introduction

In this page you can find the example usage for org.apache.mahout.math.hadoop MatrixMultiplicationJob createMatrixMultiplyJobConf.

Prototype

public static Configuration createMatrixMultiplyJobConf(Configuration initialConf, Path aPath, Path bPath,
            Path outPath, int outCardinality) 

Source Link

Usage

From source file:at.illecker.hadoop.rootbeer.examples.matrixmultiplication.DistributedRowMatrix.java

License:Apache License

/**
 * This implements matrix this.transpose().times(other)
 * // www .  j a v  a2  s .c  om
 * @param other a DistributedRowMatrix
 * @param outPath path to write result to
 * @return a DistributedRowMatrix containing the product
 */
public DistributedRowMatrix times(DistributedRowMatrix other, Path outPath) throws IOException {
    if (numRows != other.numRows()) {
        throw new CardinalityException(numRows, other.numRows());
    }

    Configuration initialConf = getConf() == null ? new Configuration() : getConf();
    Configuration conf = MatrixMultiplicationJob.createMatrixMultiplyJobConf(initialConf, rowPath,
            other.rowPath, outPath, other.numCols);
    JobClient.runJob(new JobConf(conf));
    DistributedRowMatrix out = new DistributedRowMatrix(outPath, outputTmpPath, numCols, other.numCols());
    out.setConf(conf);
    return out;
}