Examples of factorize()


Examples of edu.ucla.sspace.matrix.MatrixFactorization.factorize()

    @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());
        assertEquals(2, W.columns());
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFactorization.factorize()


        MatrixFile mFile = new MatrixFile(new File(options.getPositionalArg(0)),
                                          format);

        reducer.factorize(mFile, dimensions);

        File wordSpaceFile = new File(options.getStringOption('w'));
        MatrixIO.writeMatrix(reducer.dataClasses(), wordSpaceFile,
                             Format.DENSE_TEXT);
View Full Code Here

Examples of edu.ucla.sspace.matrix.MatrixFactorization.factorize()

        Format outputFormat = (options.hasOption('w'))
            ? getFormat(options.getStringOption('w'))
            : Format.SVDLIBC_DENSE_TEXT;

        MatrixFactorization factorizer = SVD.getFastestAvailableFactorization();
        factorizer.factorize(new MatrixFile(matrixFile, inputFormat), dimensions);
        File uFile = new File(outputDir, "U.mat");
        MatrixIO.writeMatrix(factorizer.dataClasses(), uFile, outputFormat);
        File vFile = new File(outputDir, "V.mat");
        MatrixIO.writeMatrix(factorizer.classFeatures(), vFile, outputFormat);
    }
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.recommender.svd.Factorizer.factorize()

        new KDDCupFactorizablePreferences(KDDCupDataModel.getTrainingFile(dataFileDirectory));

    Factorizer sgdFactorizer = new ParallelArraysSGDFactorizer(factorizablePreferences, numFeatures, numIterations,
        learningRate, preventOverfitting, randomNoise);

    Factorization factorization = sgdFactorizer.factorize();

    log.info("Estimating validation preferences...");
    int prefsProcessed = 0;
    RunningAverage average = new FullRunningAverage();
    for (Pair<PreferenceArray,long[]> validationPair
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.recommender.svd.Factorizer.factorize()

        new KDDCupFactorizablePreferences(KDDCupDataModel.getTrainingFile(dataFileDirectory));

    Factorizer sgdFactorizer = new ParallelArraysSGDFactorizer(factorizablePreferences, numFeatures, numIterations,
        learningRate, preventOverfitting, randomNoise);

    Factorization factorization = sgdFactorizer.factorize();

    log.info("Estimating validation preferences...");
    int prefsProcessed = 0;
    RunningAverage average = new FullRunningAverage();
    DataFileIterable validations = new DataFileIterable(KDDCupDataModel.getValidationFile(dataFileDirectory));
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.recommender.svd.Factorizer.factorize()

        new KDDCupFactorizablePreferences(KDDCupDataModel.getTrainingFile(dataFileDirectory));

    Factorizer sgdFactorizer = new ParallelArraysSGDFactorizer(factorizablePreferences, numFeatures, numIterations,
        learningRate, preventOverfitting, randomNoise);

    Factorization factorization = sgdFactorizer.factorize();

    log.info("Estimating validation preferences...");
    int prefsProcessed = 0;
    RunningAverage average = new FullRunningAverage();
    for (Pair<PreferenceArray,long[]> validationPair :
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.