public static void main(String[] args) throws Exception { Matrix m = MatrixIO.readMatrix(new File(args[0]), MatrixIO.Format.DENSE_TEXT); m = Matrices.transpose(m); File out = new File(args[1]); MatrixIO.writeMatrix(m, out, MatrixIO.Format.DENSE_TEXT); }
public static void main(String[] args) throws Exception { Matrix m = MatrixIO.readMatrix(new File(args[0]), MatrixIO.Format.DENSE_TEXT); m = Matrices.transpose(m); File out = new File(args[1]); MatrixIO.writeMatrix(m, out, MatrixIO.Format.DENSE_TEXT); }
documentSpace = Matrices.transpose(usv[2]); } catch (IOException ioe) {
documentSpace = Matrices.transpose(usv[2]); } catch (IOException ioe) {
/** * {@inheritDoc} * * @param properties {@inheritDoc} See this class's {@link * LatentSemanticAnalysis javadoc} for the full list of supported * properties. */ public void processSpace(Properties properties) { MatrixFile processedSpace = processSpace(transform); LoggerUtil.info(LOG, "reducing to %d dimensions", dimensions); reducer.factorize(processedSpace, dimensions); wordSpace = reducer.dataClasses(); // Save the reduced document space if requested. if (retainDocumentSpace) { LoggerUtil.verbose(LOG, "loading in document space"); // We transpose the document space to provide easier access to // the document vectors, which in the un-transposed version are // the columns. documentSpace = Matrices.transpose(reducer.classFeatures()); } } }
/** * {@inheritDoc} * * @param properties {@inheritDoc} See this class's {@link * LatentSemanticAnalysis javadoc} for the full list of supported * properties. */ public void processSpace(Properties properties) { // Perform any optional transformations (e.g., tf-idf) on the // term-document matrix MatrixFile processedSpace = processSpace(transform); LoggerUtil.info(LOG, "reducing to %d dimensions", dimensions); // Compute the SVD on the term-document space reducer.factorize(processedSpace, dimensions); wordSpace = reducer.dataClasses(); U = reducer.getLeftVectors(); sigma = reducer.getSingularValues(); // Save the reduced document space if requested. if (retainDocumentSpace) { LoggerUtil.verbose(LOG, "loading in document space"); // We transpose the document space to provide easier access to // the document vectors, which in the un-transposed version are // the columns. documentSpace = Matrices.transpose(reducer.classFeatures()); } }