Package org.apache.mahout.math.hadoop

Examples of org.apache.mahout.math.hadoop.MatrixMultiplicationJob$MatrixMultiplyMapper



        // this actually does a matrixB.transpose.times(matrixA)
        Path cooccurrenceMatrixPath = getTempPath(CO_OCCURRENCE_MATRIX);

        ToolRunner.run(getConf(), new MatrixMultiplicationJob(), new String[]{
            "--numRowsA", Integer.toString(numberOfUsers),
            "--numColsA", Integer.toString(numberOfItems),
            "--numRowsB", Integer.toString(numberOfUsers),
            "--numColsB", Integer.toString(numberOfItems),
            "--inputPathA", matrixBPath.toString(),
            "--inputPathB", matrixAPath.toString(),
            // huh, no option of this name???? todo: do we have to find it after the mult?
            "--outputPath", cooccurrenceMatrixPath.toString(),
            "--tempDir", tempPath.toString(),
        });

        // now [B'A] will be transposed before the multiply so we need to transpose twice?
        // calculating [B'A]H_v by first transposing the [B'A] then creating the multiply job but
        // H_v is A' (a users view history vectors are column vectors) so we have to transpose both [B'A] and A
        // since the multiply will automatically transpose the first matrix (not sure why but it does).

        ToolRunner.run(getConf(), new TransposeJob(), new String[]{
            "--input", cooccurrenceMatrixPath.toString(),
            "--numRows", Integer.toString(numberOfUsers),
            "--numCols", Integer.toString(numberOfItems),
            "--tempDir", tempPath.toString(),
        });

        Path transposedBTransposeAMatrixPath = findMostRecentPath(tempPath, "transpose");


        ToolRunner.run(getConf(), new MatrixMultiplicationJob(), new String[]{
            "--inputPathA", transposedBTransposeAMatrixPath.toString(),//[B'A]'
            "--numRowsA", Integer.toString(numberOfItems),
            "--numColsA", Integer.toString(numberOfItems),
            "--inputPathB", matrixATransposePath.toString(),
            "--numRowsB", Integer.toString(numberOfItems),
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.hadoop.MatrixMultiplicationJob$MatrixMultiplyMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.