|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.example.table.BinominalMapping
public class BinominalMapping
This is an efficient implementation of a NominalMapping
which can be used for binominal attributes, i.e. for attributes
with only two different values.
| Constructor Summary | |
|---|---|
BinominalMapping()
|
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinominalMapping()
| 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()
AbstractExampleTable and it already
contains Examples. All examples will be messed up!
sortMappings in interface NominalMappingpublic void clear()
clear in interface NominalMapping
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||