public class FeatureMap extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
FeatureMap()
Creates a feature map and sets the feature counter to 1
|
Modifier and Type | Method and Description |
---|---|
int |
addIndex(int featurePosition,
int code)
Adds a mapping from a combination of the position in the column-based feature vector and the symbol code to
an index value suitable for liblinear and libsvm.
|
int |
addIndex(int featurePosition,
int code1,
int code2) |
void |
decrementfeatureCounter() |
int |
decrementIndex(java.lang.Long key) |
int |
getFeatureCounter() |
int |
getIndex(int featurePosition,
int code)
Return
|
int |
getIndex(int featurePosition,
int code1,
int code2) |
java.lang.Integer |
removeIndex(long key) |
java.lang.Long[] |
reverseMap() |
void |
setFeatureCounter(int featureCounter) |
int |
setIndex(long key,
int index) |
int |
size() |
public FeatureMap()
public int addIndex(int featurePosition, int code)
featurePosition
- a position in the column-based feature vectorcode
- a symbol codepublic int getIndex(int featurePosition, int code)
featurePosition
- the position in the column-based feature vectorcode
- the symbol code suitable for liblinear and libsvmpublic int addIndex(int featurePosition, int code1, int code2)
public int setIndex(long key, int index)
public int decrementIndex(java.lang.Long key)
public void decrementfeatureCounter()
public java.lang.Integer removeIndex(long key)
public int getIndex(int featurePosition, int code1, int code2)
public int size()
public java.lang.Long[] reverseMap()
public void setFeatureCounter(int featureCounter)
public int getFeatureCounter()
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.