|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.example.table.PolynominalMapping
public class PolynominalMapping
This is an implementation of NominalMapping which can
be used for nominal attributes with an arbitrary number of
different values.
| Constructor Summary | |
|---|---|
PolynominalMapping()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears all mappings for nominal values. |
java.lang.Object |
clone()
Should return a deep clone of this nominal mapping. |
int |
getIndex(java.lang.String str)
Returns the index of the given nominal value or -1 if this value was not mapped before by invoking the method mapIndex(int). |
int |
getNegativeIndex()
Returns the index of the first value if this attribute is a classification attribute, i.e. if it is binominal. |
java.lang.String |
getNegativeString()
Returns the nominal value of a negative class (if available). |
int |
getPositiveIndex()
Returns the index of the second value if this attribute is a classification attribute. |
java.lang.String |
getPositiveString()
Returns the nominal value of a positive class (if available). |
java.util.List<java.lang.String> |
getValues()
Returns the values of the attribute as an enumeration of strings. |
java.lang.String |
mapIndex(int index)
Returns the attribute value, that is associated with this index. |
int |
mapString(java.lang.String str)
Returns the index for the nominal attribute value str. |
void |
setMapping(java.lang.String nominalValue,
int index)
Sets the given mapping. |
int |
size()
Returns the number of different nominal values. |
void |
sortMappings()
This method rearranges the string to number mappings such that they are in alphabetical order. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PolynominalMapping()
| Method Detail |
|---|
public java.lang.Object clone()
NominalMapping
clone in interface NominalMappingclone in class java.lang.Objectpublic int mapString(java.lang.String str)
str. If
the string is unknown, a new index value is assigned. Returns -1, if str
is null.
mapString in interface NominalMappingpublic int getIndex(java.lang.String str)
mapIndex(int).
getIndex in interface NominalMappingpublic java.lang.String mapIndex(int index)
getValues().
mapIndex in interface NominalMapping
public void setMapping(java.lang.String nominalValue,
int index)
setMapping in interface NominalMappingpublic int getNegativeIndex()
getNegativeIndex in interface NominalMappingpublic int getPositiveIndex()
getPositiveIndex in interface NominalMappingpublic java.lang.String getNegativeString()
NominalMapping
getNegativeString in interface NominalMappingpublic java.lang.String getPositiveString()
NominalMapping
getPositiveString in interface NominalMappingpublic java.util.List<java.lang.String> getValues()
getValues in interface NominalMappingpublic int size()
size in interface NominalMappingpublic void sortMappings()
ExampleTable and it already
contains Examples. All examples will be messed up since the
indices will not be replaced in the data table.
sortMappings in interface NominalMappingpublic void clear()
clear in interface NominalMappingpublic java.lang.String toString()
toString in class java.lang.Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||