try { String formatString = ""; switch (mFile.getFormat()) { case SVDLIBC_DENSE_BINARY: formatString = " -r db ";
switch (mFile.getFormat()) { case SVDLIBC_DENSE_BINARY: formatString = " -r db ";
/** * {@inheritDoc} * * @param properties {@inheritDoc} See this class's {@link VectorSpaceModel * javadoc} for the full list of supported properties. */ public void processSpace(Properties properties) { try { Transform transform = null; // Load any optionally specifie transform class String transformClass = properties.getProperty(MATRIX_TRANSFORM_PROPERTY); if (transformClass != null) transform = ReflectionUtil.getObjectInstance( transformClass); MatrixFile processedSpace = super.processSpace(transform); System.out.printf("Matrix saved in %s as %s%n", processedSpace.getFile(), processedSpace.getFormat()); wordSpace = MatrixIO.readMatrix(processedSpace.getFile(), processedSpace.getFormat()); System.out.printf("loaded word space of %d x %d%n", wordSpace.rows(), wordSpace.columns()); } catch (IOException ioe) { throw new IOError(ioe); } } }
/** * {@inheritDoc} */ public void factorize(MatrixFile mFile, int dimensions) { try { Matrix[] SVD = SvdlibjDriver.svd( mFile.getFile(), mFile.getFormat(), dimensions); dataClasses = SVD[0]; scaledDataClasses = false; classFeatures = SVD[2]; scaledClassFeatures = false; singularValues = new double[dimensions]; for (int k = 0; k < dimensions; ++k) singularValues[k] = SVD[1].get(k, k); } catch (IOException ioe) { throw new IOError(ioe); } }
MatrixIO.Format format = input.getFormat();
/** * {@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); } }
/** * {@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); } }
MatrixIO.Format format = input.getFormat();
MatrixIO.Format format = input.getFormat();
MatrixIO.Format format = input.getFormat();
transformedMatrix.getFormat(), Matrix.Type.SPARSE_IN_MEMORY, true);
transformedMatrix.getFormat(), Matrix.Type.SPARSE_IN_MEMORY, true);