edu.umass.cs.mallet.base.pipe
Class Csv2FeatureVector

java.lang.Object
  extended byedu.umass.cs.mallet.base.pipe.Pipe
      extended byedu.umass.cs.mallet.base.pipe.Csv2FeatureVector
All Implemented Interfaces:
java.io.Serializable

public class Csv2FeatureVector
extends Pipe

Converts a string of the form feature_1:val_1 feature_2:val_2 ... feature_k:val_k into a (sparse) FeatureVector.

See Also:
Serialized Form

Constructor Summary
Csv2FeatureVector()
           
Csv2FeatureVector(int capacity)
           
 
Method Summary
 Instance pipe(Instance carrier)
          Convert the data in the given Instance from a CharSequence of sparse feature-value pairs to a FeatureVector
 
Methods inherited from class edu.umass.cs.mallet.base.pipe.Pipe
getDataAlphabet, getInstanceId, getParent, getParentRoot, getTargetAlphabet, isDataAlphabetSet, isTargetProcessing, pipe, readResolve, resolveDataAlphabet, resolveTargetAlphabet, setDataAlphabet, setParent, setTargetAlphabet, setTargetProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Csv2FeatureVector

public Csv2FeatureVector(int capacity)

Csv2FeatureVector

public Csv2FeatureVector()
Method Detail

pipe

public Instance pipe(Instance carrier)
              throws java.lang.IllegalStateException
Convert the data in the given Instance from a CharSequence of sparse feature-value pairs to a FeatureVector

Specified by:
pipe in class Pipe
Parameters:
carrier - Instance to be processed.
Throws:
java.lang.IllegalStateException - If Instance.getTarget() is not a Labeling