com.rapidminer.example.table
Interface NominalMapping

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
BinominalMapping, PolynominalMapping

public interface NominalMapping
extends java.lang.Cloneable, java.io.Serializable

This class is used to map between the nominal values for a certain attribute and the internal double value representations which is used for nominal values in order to reduce memory usage.

Author:
Ingo Mierswa

Method Summary
 void clear()
          Clears the mapping.
 java.lang.Object clone()
          Should return a deep clone of this nominal mapping.
 int getIndex(java.lang.String nominalValue)
          Returns the internal double representation (actually an integer index) for the given nominal value without creating a mapping if none exists.
 int getNegativeIndex()
          Returns the index of a negative class (if available).
 java.lang.String getNegativeString()
          Returns the nominal value of a negative class (if available).
 int getPositiveIndex()
          Returns the index of a positive class (if available).
 java.lang.String getPositiveString()
          Returns the nominal value of a positive class (if available).
 java.util.List<java.lang.String> getValues()
          Returns a list of all nominal values which were mapped via mapString(String) until now.
 java.lang.String mapIndex(int index)
          Returns the nominal value for an internal double representation (actually an integer index).
 int mapString(java.lang.String nominalValue)
          Returns the internal double representation (actually an integer index) for the given nominal value.
 void setMapping(java.lang.String nominalValue, int index)
          Sets the given mapping.
 int size()
          Returns the number of different nominal values which were mapped via mapString(String) until now.
 void sortMappings()
          This method rearranges the string to number mappings such that they are in alphabetical order.
 

Method Detail

clone

java.lang.Object clone()
Should return a deep clone of this nominal mapping.


getPositiveIndex

int getPositiveIndex()
Returns the index of a positive class (if available). Returns -1 otherwise.


getPositiveString

java.lang.String getPositiveString()
Returns the nominal value of a positive class (if available). Returns null otherwise.


getNegativeIndex

int getNegativeIndex()
Returns the index of a negative class (if available). Returns -1 otherwise.


getNegativeString

java.lang.String getNegativeString()
Returns the nominal value of a negative class (if available). Returns null otherwise.


getIndex

int getIndex(java.lang.String nominalValue)
Returns the internal double representation (actually an integer index) for the given nominal value without creating a mapping if none exists.


mapString

int mapString(java.lang.String nominalValue)
Returns the internal double representation (actually an integer index) for the given nominal value. This method creates a mapping if it did not exist before.


mapIndex

java.lang.String mapIndex(int index)
Returns the nominal value for an internal double representation (actually an integer index). This method only works for nominal values which were formerly mapped via mapString(String).


setMapping

void setMapping(java.lang.String nominalValue,
                int index)
Sets the given mapping. This might be practical for example for replacing a nominal value (without a data scan!).


getValues

java.util.List<java.lang.String> getValues()
Returns a list of all nominal values which were mapped via mapString(String) until now.


size

int size()
Returns the number of different nominal values which were mapped via mapString(String) until now.


sortMappings

void sortMappings()
This method rearranges the string to number mappings such that they are in alphabetical order.
VERY IMPORTANT NOTE: Do not call this method when this attribute is already associated with an AbstractExampleTable and it already contains Examples. All examples will be messed up otherwise!


clear

void clear()
Clears the mapping.



Copyright © 2001-2009 by Rapid-I