/** * Creates a new {@link LatentSemanticAnalysis} instance with the specified * number of dimensions, using the specified method for performing the SVD. * This intializes {@Link LatentSemanticAnalysis} with the default * parameters set in the original paper for all other parameter values. * This construct initializes this instance such that the document space is * <i>not</i> retained. * * @param dimensions The number of dimensions to retain in the reduced space */ public LatentSemanticAnalysis(int numDimensions, SingularValueDecomposition svdMethod) throws IOException { this(false, numDimensions, new LogEntropyTransform(), svdMethod, false, new StringBasisMapping()); }
/** * Creates a new {@link LatentSemanticAnalysis} instance. This intializes * {@Link LatentSemanticAnalysis} with the default parameters set in the * original paper. This construct initializes this instance such that the * document space is <i>not</i> retained. */ public LatentSemanticAnalysis() throws IOException { this(false, 300, new LogEntropyTransform(), SVD.getFastestAvailableFactorization(), false, new StringBasisMapping()); }
/** * Creates a new {@link LatentSemanticAnalysis} instance. This intializes * {@Link LatentSemanticAnalysis} with the default parameters set in the * original paper. */ public LatentSemanticAnalysis() throws IOException { this(false, 300, new LogEntropyTransform(), SVD.getFastestAvailableFactorization(), false, new StringBasisMapping()); }
/** * Creates a new {@link LatentSemanticAnalysis} instance with the specified * number of dimensions. This intializes {@Link LatentSemanticAnalysis} * with the default parameters set in the original paper for all other * parameter values. This construct initializes this instance such that the * document space is <i>not</i> retained. * * @param dimensions The number of dimensions to retain in the reduced space */ public LatentSemanticAnalysis(int numDimensions) throws IOException { this(false, numDimensions, new LogEntropyTransform(), SVD.getFastestAvailableFactorization(), false, new StringBasisMapping()); }
/** * Creates a new {@link LatentSemanticAnalysis} instance with the specified * number of dimensions, which optionally retains both the word and document * spaces. This intializes {@Link LatentSemanticAnalysis} with the default * parameters set in the original paper for all other parameter values. * * @param dimensions The number of dimensions to retain in the reduced space * @param retainDocumentSpace If true, the document space will be made * accessible */ public LatentSemanticAnalysis(int numDimensions, boolean retainDocumentSpace) throws IOException { this(retainDocumentSpace, numDimensions, new LogEntropyTransform(), SVD.getFastestAvailableFactorization(), false, new StringBasisMapping()); }
Transform transform = new LogEntropyTransform();
Transform transform = new LogEntropyTransform();
protected SemanticSpace getSpace() { try { int dimensions = argOptions.getIntOption("dimensions", 300); Transform transform = new LogEntropyTransform(); if (argOptions.hasOption("preprocess")) transform = ReflectionUtil.getObjectInstance( argOptions.getStringOption("preprocess")); String algName = argOptions.getStringOption("svdAlgorithm", "ANY"); MatrixFactorization factorization = new NonNegativeMatrixFactorizationMultiplicative(); basis = new StringBasisMapping(); throw new IOException("Not sure what to do"); // return new LatentSemanticAnalysis( // true, dimensions, transform, factorization, false, basis); } catch (IOException ioe) { throw new IOError(ioe); } }
protected SemanticSpace getSpace() { try { int dimensions = argOptions.getIntOption("dimensions", 300); Transform transform = new LogEntropyTransform(); if (argOptions.hasOption("preprocess")) transform = ReflectionUtil.getObjectInstance( argOptions.getStringOption("preprocess")); String algName = argOptions.getStringOption("svdAlgorithm", "ANY"); MatrixFactorization factorization = SVD.getFactorization( Algorithm.valueOf(algName.toUpperCase())); basis = new StringBasisMapping(); return new LatentSemanticAnalysis( false, dimensions, transform, factorization, false, basis); } catch (IOException ioe) { throw new IOError(ioe); } }
protected SemanticSpace getSpace() { try { int dimensions = argOptions.getIntOption("dimensions", 300); Transform transform = new LogEntropyTransform(); if (argOptions.hasOption("preprocess")) transform = ReflectionUtil.getObjectInstance( argOptions.getStringOption("preprocess")); String algName = argOptions.getStringOption("svdAlgorithm", "ANY"); SingularValueDecomposition factorization = SVD.getFactorization( Algorithm.valueOf(algName.toUpperCase())); basis = new StringBasisMapping(); return new LatentSemanticAnalysis( false, dimensions, transform, factorization, false, basis); } catch (IOException ioe) { throw new IOError(ioe); } }
protected SemanticSpace getSpace() { try { int dimensions = argOptions.getIntOption("dimensions", 300); Transform transform = new LogEntropyTransform(); if (argOptions.hasOption("preprocess")) transform = ReflectionUtil.getObjectInstance( argOptions.getStringOption("preprocess")); String algName = argOptions.getStringOption("svdAlgorithm", "ANY"); MatrixFactorization factorization = new NonNegativeMatrixFactorizationMultiplicative(); basis = new StringBasisMapping(); return new LatentSemanticAnalysis( true, dimensions, transform, factorization, false, basis); } catch (IOException ioe) { throw new IOError(ioe); } }