Examples of MatrixFile


Examples of edu.ucla.sspace.matrix.MatrixFile

    public void factorize(SparseMatrix matrix, int dimensions) {
        try {
            File mFile = File.createTempFile("matlab-input", ".dat");
            MatrixIO.writeMatrix(matrix, mFile, Format.MATLAB_SPARSE);
            factorize(new MatrixFile(mFile, Format.MATLAB_SPARSE), dimensions);
        } catch (IOException ioe) {
            LOG.log(Level.SEVERE, "Converting to matlab file", ioe);
        }
    }
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFile

     */
    public void factorize(SparseMatrix matrix, int dimensions) {
        try {
            File temp = File.createTempFile("svdlibc.svd.matrix", "dat");
            MatrixIO.writeMatrix(matrix, temp, Format.SVDLIBC_SPARSE_TEXT);
            MatrixFile mFile = new MatrixFile(temp, Format.SVDLIBC_SPARSE_TEXT);
            factorize(mFile, dimensions);
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
    }
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFile

    public void factorize(SparseMatrix matrix, int dimensions) {
        try {
            File mFile = File.createTempFile("octave-input", ".dat");
            MatrixIO.writeMatrix(matrix, mFile, Format.MATLAB_SPARSE);
            factorize(new MatrixFile(mFile, Format.MATLAB_SPARSE), dimensions);
        } catch (IOException ioe) {
            LOG.log(Level.SEVERE, "Converting to matlab file", ioe);
        }
    }
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFile

            format = Format.SVDLIBC_SPARSE_BINARY;
        } else
            System.exit(1);


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

        reducer.factorize(mFile, dimensions);

        File wordSpaceFile = new File(options.getStringOption('w'));
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFile

        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

Examples of edu.ucla.sspace.matrix.MatrixFile

    /**
     * {@inheritDoc}
     */
    public void processSpace(Properties properties) {
        try {
            MatrixFile processedSpace = processSpace(
                    new TfIdfTransform());
            wordSpace = MatrixIO.readMatrix(
                    processedSpace.getFile(), processedSpace.getFormat());
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
    }
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.