Package edu.ucla.sspace.matrix

Examples of edu.ucla.sspace.matrix.MatrixFactorization.factorize()


    @Test public void testReduction() {
        MatrixFactorization reducer =
            new NonNegativeMatrixFactorizationMultiplicative();
        SparseMatrix matrix = new YaleSparseMatrix(VALUES);

        reducer.factorize(matrix, 2);

        Matrix W = reducer.dataClasses();
        assertEquals(4, W.rows());
        assertEquals(2, W.columns());
View Full Code Here



        MatrixFile mFile = new MatrixFile(new File(options.getPositionalArg(0)),
                                          format);

        reducer.factorize(mFile, dimensions);

        File wordSpaceFile = new File(options.getStringOption('w'));
        MatrixIO.writeMatrix(reducer.dataClasses(), wordSpaceFile,
                             Format.DENSE_TEXT);
View Full Code Here

        Format outputFormat = (options.hasOption('w'))
            ? getFormat(options.getStringOption('w'))
            : Format.SVDLIBC_DENSE_TEXT;

        MatrixFactorization factorizer = SVD.getFastestAvailableFactorization();
        factorizer.factorize(new MatrixFile(matrixFile, inputFormat), dimensions);
        File uFile = new File(outputDir, "U.mat");
        MatrixIO.writeMatrix(factorizer.dataClasses(), uFile, outputFormat);
        File vFile = new File(outputDir, "V.mat");
        MatrixIO.writeMatrix(factorizer.classFeatures(), vFile, outputFormat);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.