org.apache.mahout.math.hadoop.similarity.vector
Class DistributedCooccurrenceVectorSimilarity
java.lang.Object
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
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 |
DistributedCooccurrenceVectorSimilarity
public DistributedCooccurrenceVectorSimilarity()
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 rowrowB
- offset of the second rowcooccurrences
- all column entries where both vectors have a nonZero entryweightOfVectorA
- the result of DistributedVectorSimilarity.weight(Vector)
for the first row vectorweightOfVectorB
- the result of DistributedVectorSimilarity.weight(Vector)
for the first row vector
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.