org.apache.mahout.math
Class MultiLabelVectorWritable
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.mahout.math.VectorWritable
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.
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 |
MultiLabelVectorWritable
public MultiLabelVectorWritable()
MultiLabelVectorWritable
public MultiLabelVectorWritable(Vector v,
int[] labels)
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.