cc.mallet.pipe
Class Csv2FeatureVector

java.lang.Object
  extended by cc.mallet.pipe.Pipe
      extended by cc.mallet.pipe.Csv2FeatureVector
All Implemented Interfaces:
AlphabetCarrying, 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. Features with no ":" character are assumed to have value 1.0.

Author:
Gary Huang
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 cc.mallet.pipe.Pipe
alphabetsMatch, getAlphabet, getAlphabets, getDataAlphabet, getInstanceId, getTargetAlphabet, instanceFrom, instancesFrom, instancesFrom, isDataAlphabetSet, isTargetProcessing, newIteratorFrom, preceedingPipeDataAlphabetNotification, preceedingPipeTargetAlphabetNotification, precondition, readResolve, setDataAlphabet, setOrCheckDataAlphabet, setOrCheckTargetAlphabet, 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)
Convert the data in the given Instance from a CharSequence of sparse feature-value pairs to a FeatureVector

Overrides:
pipe in class Pipe