Package edu.ucla.sspace.matrix

Examples of edu.ucla.sspace.matrix.Transform


    }
   
    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(
View Full Code Here


    }
   
    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 =
View Full Code Here

                NUM_REFERENCE_DATA_SETS, DEFAULT_NUM_REFERENCE_DATA_SETS));
        int numIterations = maxClusters - startSize;
        String criterion = props.getProperty(METHOD_PROPERTY, DEFAULT_METHOD);

        verbose("Transforming the original data set");
        Transform tfidf = new TfIdfDocStripedTransform();
        Transform rowMag = new RowMagnitudeTransform();
        m = rowMag.transform(tfidf.transform(m));

        verbose("Generating the reference data set");
        // Generate the reference data sets.
        ReferenceDataGenerator generator = new ReferenceDataGenerator(m);
        Matrix[] gapMatrices = new Matrix[numGaps];
        for (int i = 0; i < numGaps; ++i)
            gapMatrices[i] = rowMag.transform(tfidf.transform(
                    generator.generateTestData()));

        double[] gapResults = new double[numIterations];
        double[] gapStds = new double[numIterations];
        Assignments[] gapAssignments = new Assignments[numIterations];
View Full Code Here

   
    /**
     * {@inheritDoc}
     */
    public SemanticSpace getSpace() {
        Transform transform = new CorrelationTransform();
        MatrixFactorization reducer = (argOptions.hasOption("reduce"))
            ? SVD.getFastestAvailableFactorization()
            : null;

        return new Coals(transform, reducer,
View Full Code Here

     *        LocalityPreservingSemanticAnalysis javadoc} for the full list of
     *        supported properties.
     */
    public void processSpace(Properties properties) {
        try {
            Transform transform = null;
            // If the user specified a transform, then apply it and update the
            // matrix file
            String transformClass =
                properties.getProperty(MATRIX_TRANSFORM_PROPERTY);
            if (transformClass != null)
View Full Code Here

     * @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)
View Full Code Here

     */
    protected SemanticSpace getSpace() {
        setupDependencyExtractor();

        int bound = argOptions.getIntOption('b', 10000);
        Transform transform = argOptions.getObjectOption(
                'T', new NoTransform());
        DependencyPathAcceptor acceptor = argOptions.getObjectOption(
                'a', new UniversalPathAcceptor());
        DependencyPathWeight weighter = argOptions.getObjectOption(
                'w', new FlatPathWeight());
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected SemanticSpace getSpace() {
        Transform transform = null;
        if (argOptions.hasOption('T'))
            transform = ReflectionUtil.getObjectInstance(
                    argOptions.getStringOption('T'));
        else
            transform = new NoTransform();
View Full Code Here

    public void processSpace(Properties properties) {
        try {
            // first ensure that we are no longer writing to the matrix
            termDocumentMatrixBuilder.finish();

            Transform transform = new LogEntropyTransform();

            String transformClass =
            properties.getProperty(MATRIX_TRANSFORM_PROPERTY);
            if (transformClass != null) {
                try {
                    Class clazz = Class.forName(transformClass);
                    transform = (Transform)(clazz.newInstance());
                }
                // perform a general catch here due to the number of possible
                // things that could go wrong.  Rethrow all exceptions as an
                // error.
                catch (Exception e) {
                    throw new Error(e);
                }
            }

            LSA_LOGGER.info("performing " + transform + " transform");

                // Get the finished matrix file from the builder
            File termDocumentMatrix = termDocumentMatrixBuilder.getFile();
            if (LSA_LOGGER.isLoggable(Level.FINE)) {
                LSA_LOGGER.fine("stored term-document matrix in format " +
                        termDocumentMatrixBuilder.getMatrixFormat()
                        + " at " + termDocumentMatrix.getAbsolutePath());
            }

            // Convert the raw term counts using the specified transform
            File transformedMatrix = transform.transform(termDocumentMatrix,
                    termDocumentMatrixBuilder.getMatrixFormat());

            if (LSA_LOGGER.isLoggable(Level.FINE)) {
                LSA_LOGGER.fine("transformed matrix to " +
                        transformedMatrix.getAbsolutePath());
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.matrix.Transform

Copyright © 2018 www.massapicom. 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.