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);
}