Class ClassMapper
- java.lang.Object
-
- ai.libs.jaicore.ml.classification.singlelabel.timeseries.util.ClassMapper
-
public class ClassMapper extends java.lang.ObjectClass mapper used for predictions of String objects which are internally predicted by time series classifiers as ints.
-
-
Constructor Summary
Constructors Constructor Description ClassMapper(java.util.List<java.lang.String> classValues)Constructor using a list of String value to realize the mapping
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getClassValues()Getter for theclassValues.java.lang.Stringmap(int index)Maps an integer value to a string based on the positionindexin theclassValues.intmap(java.lang.String value)Maps a String value to an integer value based on thevalue's position in theclassValues.voidsetClassValues(java.util.List<java.lang.String> classValues)Setter for theclassValues.
-
-
-
Method Detail
-
map
public int map(java.lang.String value)
Maps a String value to an integer value based on thevalue's position in theclassValues.- Parameters:
value- The value to be looked up- Returns:
- Returns the mapped index or -1 if not stored
-
map
public java.lang.String map(int index)
Maps an integer value to a string based on the positionindexin theclassValues.- Parameters:
index- The index used for the lookup- Returns:
- Returns the given string at the position
index
-
getClassValues
public java.util.List<java.lang.String> getClassValues()
Getter for theclassValues.- Returns:
- Returns the stored class values
-
setClassValues
public void setClassValues(java.util.List<java.lang.String> classValues)
Setter for theclassValues.- Parameters:
classValues- The class values to be set.
-
-