Package edu.ucla.sspace.matrix

Examples of edu.ucla.sspace.matrix.SparseMatrix


    };

    @Test public void testReduction() {
        MatrixFactorization reducer =
            new NonNegativeMatrixFactorizationMultiplicative();
        SparseMatrix matrix = new YaleSparseMatrix(VALUES);

        reducer.factorize(matrix, 2);

        Matrix W = reducer.dataClasses();
        assertEquals(4, W.rows());
View Full Code Here


        }

        Properties props = System.getProperties();
        Assignments assignments = null;
        if (sparseVectors.size() > 0) {
            SparseMatrix matrix = Matrices.asSparseMatrix(sparseVectors);
            assignments = (numClusters > 0)
                ? clustering.cluster(matrix, numClusters, props)
                : clustering.cluster(matrix, props);
        } else {
            Matrix matrix = Matrices.asMatrix(vectors);
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public void processSpace(Properties properties) {
            SparseMatrix cleanedMatrix = (SparseMatrix) transform.transform(
                    cooccurrenceMatrix);
            for (String term : basis.keySet()) {
                int index = basis.getDimension(term);
                SparseDoubleVector sdv = cleanedMatrix.getRowVector(index);

                double score = 0;
                for (int i : sdv.getNonZeroIndices())
                    score += sdv.get(i);

View Full Code Here

        /**
         * {@inheritDoc}
         */
        public void processSpace(Properties properties) {
            SparseMatrix cleanedMatrix = (SparseMatrix) transform.transform(
                    cooccurrenceMatrix);
            for (String term : basis.keySet()) {
                int index = basis.getDimension(term);
                SparseDoubleVector sdv = cleanedMatrix.getRowVector(index);

                double score = 0;
                for (int i : sdv.getNonZeroIndices())
                    score += sdv.get(i);

View Full Code Here

TOP

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

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.