|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.lth.cs.nlp.nlputils.ml.NumericEncoding
public class NumericEncoding
Mapping from symbolic feature values to numeric values.
Constructor Summary | |
---|---|
NumericEncoding(int n_features,
HashMap<String,Integer>[] maps,
HashMap<String,Integer> outValueNumbers,
int[] types,
int[] indices)
|
Method Summary | |
---|---|
static NumericEncoding |
createEncoding(String inFile,
HashMap<String,Integer> predefined)
Creates a NumericEncoding from a training file. |
Object |
decodeTarget(int i)
Decodes a target value. |
int[] |
encode(FeatureList features)
Encodes a feature list. |
int[] |
encodeStrings(String[] ss)
Encodes a list of symbolic strings. |
int |
encodeTarget(Object t)
Encodes a target value. |
int[] |
encodeTargets(Collection classes)
Encodes a collection of target values. |
int |
getNFeatures()
Returns the number of features. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumericEncoding(int n_features, HashMap<String,Integer>[] maps, HashMap<String,Integer> outValueNumbers, int[] types, int[] indices)
Method Detail |
---|
public int[] encode(FeatureList features)
features
- the feature list.
public int[] encodeStrings(String[] ss)
ss
- the features.
public int encodeTarget(Object t)
t
- the target value.
public int[] encodeTargets(Collection classes)
classes
- the target values.
public Object decodeTarget(int i)
i
- the numerical target value.
public static NumericEncoding createEncoding(String inFile, HashMap<String,Integer> predefined)
inFile
- the file to process.predefined
- a mapping of predefined target values. May be null.
public int getNFeatures()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |