com.aliasi.features
Class Features

java.lang.Object
  extended by com.aliasi.features.Features

public class Features
extends Object

The Features class contains static utility classes for manipulating features.

Since:
LingPipe3.9
Version:
3.8.1
Author:
Bob Carpenter

Method Summary
static Vector toVector(Map<String,? extends Number> featureVector, SymbolTable table, int numDimensions, boolean addIntercept)
          Convert the specified feature vector into a sparse float vector using the specified symbol table to encode features as integers.
static Vector toVectorAddSymbols(Map<String,? extends Number> featureVector, SymbolTable table, int numDimensions, boolean addIntercept)
          Convert the specified feature vector into a sparse float vector using the specified symbol table to encode features as integers, adding features to the symbol table if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toVectorAddSymbols

public static Vector toVectorAddSymbols(Map<String,? extends Number> featureVector,
                                        SymbolTable table,
                                        int numDimensions,
                                        boolean addIntercept)
Convert the specified feature vector into a sparse float vector using the specified symbol table to encode features as integers, adding features to the symbol table if necessary. Features that do not exist as symbols in the symbol table will be added to the symbol table. If the add intercept flag is set to true, an intercept value of 1.0 will be added as the value of dimension 0.

Parameters:
table - Symbol table for encoding features as integers.
featureVector - Feature vector to convert to sparse float vector.
numDimensions - Number of dimensions for the vector.
addIntercept - Flag indicating whether or not to add an intercept value of 1.0 at position 0.
Returns:
Sparse float vector encoding the feature vector with the symbol table.

toVector

public static Vector toVector(Map<String,? extends Number> featureVector,
                              SymbolTable table,
                              int numDimensions,
                              boolean addIntercept)
Convert the specified feature vector into a sparse float vector using the specified symbol table to encode features as integers. Features that do not exist as symbols in the symbol table will be ignored. If the add intercept flag is set to true, an intercept value of 1.0 will be added as the value of dimension 0.

Parameters:
table - Symbol table for encoding features as integers.
featureVector - Feature vector to convert to sparse float vector.
numDimensions - Number of dimensions for the vector.
addIntercept - Flag indicating whether or not to add an intercept value of 1.0 at position 0.
Returns:
Sparse float vector encoding the feature vector with the symbol table.