Package org.apache.mahout.math.hadoop.similarity.RowSimilarityJob

Examples of org.apache.mahout.math.hadoop.similarity.RowSimilarityJob.SimilarityReducer


    context.write(EasyMock.eq(new SimilarityMatrixEntryKey(34, 0.5)),
        MathHelper.matrixEntryMatches(34, 12, 0.5));

    EasyMock.replay(context);

    SimilarityReducer reducer = new SimilarityReducer();
    setField(reducer, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    reducer.reduce(new WeightedRowPair(12, 34, 3.0, 3.0), Arrays.asList(new Cooccurrence(56, 1.0, 2.0),
        new Cooccurrence(78, 3.0, 6.0)), context);

    EasyMock.verify(context);
  }
View Full Code Here


    context.write(EasyMock.eq(new SimilarityMatrixEntryKey(90, 1.0)), MathHelper.matrixEntryMatches(90, 90, 1.0));

    EasyMock.replay(context);

    SimilarityReducer reducer = new SimilarityReducer();
    setField(reducer, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    reducer.reduce(new WeightedRowPair(90, 90, 2.0, 2.0), Arrays.asList(new Cooccurrence(56, 1.0, 2.0),
        new Cooccurrence(78, 3.0, 6.0)), context);

    EasyMock.verify(context);
  }
View Full Code Here

    EasyMock.expect(context.getCounter(RowSimilarityJob.Counter.SIMILAR_ROWS)).andReturn(counter);
    counter.increment(1);

    EasyMock.replay(context, counter);

    SimilarityReducer reducer = new SimilarityReducer();
    setField(reducer, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    reducer.reduce(new WeightedRowPair(12, 34, 3.0, 3.0), Arrays.asList(new Cooccurrence(56, 1.0, 2.0),
        new Cooccurrence(78, 3.0, 6.0)), context);

    EasyMock.verify(context, counter);
  }
View Full Code Here

    EasyMock.expect(context.getCounter(RowSimilarityJob.Counter.SIMILAR_ROWS)).andReturn(counter);
    counter.increment(1);

    EasyMock.replay(context, counter);

    SimilarityReducer reducer = new SimilarityReducer();
    setField(reducer, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    reducer.reduce(new WeightedRowPair(90, 90, 2.0, 2.0), Arrays.asList(new Cooccurrence(56, 1.0, 2.0),
        new Cooccurrence(78, 3.0, 6.0)), context);

    EasyMock.verify(context, counter);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.hadoop.similarity.RowSimilarityJob.SimilarityReducer

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.