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

Examples of org.apache.mahout.math.hadoop.similarity.vector.DistributedTanimotoCoefficientVectorSimilarity


    Vector vector = new RandomAccessSparseVector(Integer.MAX_VALUE);
    vector.set(456, 0.5);
    vector.set(789, 0.1);

    RowSimilarityJob.RowWeightMapper mapper = new RowSimilarityJob.RowWeightMapper();
    setField(mapper, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    mapper.map(new IntWritable(123), new VectorWritable(vector), context);

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


        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

    Vector vector = new RandomAccessSparseVector(Integer.MAX_VALUE);
    vector.set(456, 0.5);
    vector.set(789, 0.1);

    RowSimilarityJob.RowWeightMapper mapper = new RowSimilarityJob.RowWeightMapper();
    setField(mapper, "similarity", new DistributedTanimotoCoefficientVectorSimilarity());

    mapper.map(new IntWritable(123), new VectorWritable(vector), context);

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

    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

    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.vector.DistributedTanimotoCoefficientVectorSimilarity

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.