Package cc.mallet.pipe
Class Array2FeatureVector
- java.lang.Object
-
- cc.mallet.pipe.Pipe
-
- cc.mallet.pipe.Array2FeatureVector
-
- All Implemented Interfaces:
AlphabetCarrying
,java.io.Serializable
public class Array2FeatureVector extends Pipe
Converts a Java array of numerical types to a FeatureVector, where the Alphabet is the data array index wrapped in an Integer object.- Author:
- Jerod Weinman weinman@cs.umass.edu
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Array2FeatureVector()
Array2FeatureVector(int capacity)
Array2FeatureVector(Alphabet dataAlphabet, Alphabet targetAlphabet)
Construct a pipe based on the dimensions of the data and target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instance
pipe(Instance carrier)
Convert the data in anInstance
from an array to aFeatureVector
leaving other fields unchanged.int
size()
Current size of the Vocabulary-
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
-
-
-
-
Method Detail
-
pipe
public Instance pipe(Instance carrier) throws java.lang.IllegalStateException
Convert the data in anInstance
from an array to aFeatureVector
leaving other fields unchanged.Instance.getData()
must return a numeric array, and it is cast todouble[]
-
size
public int size()
Current size of the Vocabulary
-
-