org.apache.mahout.math
Class MultiLabelVectorWritable

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.mahout.math.VectorWritable
          extended by org.apache.mahout.math.MultiLabelVectorWritable
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable

public class MultiLabelVectorWritable
extends VectorWritable

Writable to handle serialization of a vector and a variable list of associated label indexes.


Constructor Summary
MultiLabelVectorWritable()
           
MultiLabelVectorWritable(Vector v, int[] labels)
           
 
Method Summary
 int[] getLabels()
           
static MultiLabelVectorWritable read(java.io.DataInput in)
           
 void readFields(java.io.DataInput in)
           
 void setLabels(int[] labels)
           
 void write(java.io.DataOutput out)
           
static void write(java.io.DataOutput out, SequentialAccessSparseVector ssv, int[] labels)
           
 
Methods inherited from class org.apache.mahout.math.VectorWritable
get, set, writeVector
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLabelVectorWritable

public MultiLabelVectorWritable()

MultiLabelVectorWritable

public MultiLabelVectorWritable(Vector v,
                                int[] labels)
Method Detail

setLabels

public void setLabels(int[] labels)

getLabels

public int[] getLabels()

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class VectorWritable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class VectorWritable
Throws:
java.io.IOException

read

public static MultiLabelVectorWritable read(java.io.DataInput in)
                                     throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(java.io.DataOutput out,
                         SequentialAccessSparseVector ssv,
                         int[] labels)
                  throws java.io.IOException
Throws:
java.io.IOException


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