org.apache.mahout.math.hadoop.similarity.vector
Class DistributedCooccurrenceVectorSimilarity

java.lang.Object
  extended by org.apache.mahout.math.hadoop.similarity.vector.DistributedCooccurrenceVectorSimilarity
All Implemented Interfaces:
DistributedVectorSimilarity

public class DistributedCooccurrenceVectorSimilarity
extends java.lang.Object
implements DistributedVectorSimilarity

uses the co-occcurence count as vector similarity


Constructor Summary
DistributedCooccurrenceVectorSimilarity()
           
 
Method Summary
 double similarity(int rowA, int rowB, java.lang.Iterable<Cooccurrence> cooccurrences, double weightOfVectorA, double weightOfVectorB, int numberOfColumns)
          compute the similarity of a pair of row vectors
 double weight(Vector v)
          compute the weight (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedCooccurrenceVectorSimilarity

public DistributedCooccurrenceVectorSimilarity()
Method Detail

weight

public double weight(Vector v)
Description copied from interface: DistributedVectorSimilarity
compute the weight (e.g. length) of a vector

Specified by:
weight in interface DistributedVectorSimilarity

similarity

public double similarity(int rowA,
                         int rowB,
                         java.lang.Iterable<Cooccurrence> cooccurrences,
                         double weightOfVectorA,
                         double weightOfVectorB,
                         int numberOfColumns)
Description copied from interface: DistributedVectorSimilarity
compute the similarity of a pair of row vectors

Specified by:
similarity in interface DistributedVectorSimilarity
Parameters:
rowA - offset of the first row
rowB - offset of the second row
cooccurrences - all column entries where both vectors have a nonZero entry
weightOfVectorA - the result of DistributedVectorSimilarity.weight(Vector) for the first row vector
weightOfVectorB - the result of DistributedVectorSimilarity.weight(Vector) for the first row vector


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.