org.apache.mahout.math.hadoop.similarity
Class SimilarityMatrixEntryKey
java.lang.Object
org.apache.mahout.math.hadoop.similarity.SimilarityMatrixEntryKey
- All Implemented Interfaces:
- Comparable<SimilarityMatrixEntryKey>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<SimilarityMatrixEntryKey>
public class SimilarityMatrixEntryKey
- extends Object
- implements org.apache.hadoop.io.WritableComparable<SimilarityMatrixEntryKey>
used as key for the RowSimilarityJob.EntriesToVectorsReducer
to collect all rows similar to the specified row
ensures that the similarity matrix entries for a row are seen in descending order
by their similarity value via secondary sort
SimilarityMatrixEntryKey
public SimilarityMatrixEntryKey()
SimilarityMatrixEntryKey
public SimilarityMatrixEntryKey(int row,
double value)
set
public void set(int row,
double value)
getRow
public int getRow()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
compareTo
public int compareTo(SimilarityMatrixEntryKey other)
- Specified by:
compareTo
in interface Comparable<SimilarityMatrixEntryKey>
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object
Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.