|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.data.Label
public class Label
This class represents a label for an instance. The label is represented as an array of all possible labels. Note that for hierarchical and multi-label problems, where more than one label can be associated with an instance, the array can have more than one position active.
Method Summary | |
---|---|
boolean |
active(int index)
Returns true is the specified class label index is active. |
boolean |
active(java.lang.String value)
Returns true is the specified class label is active. |
int |
cardinality()
Returns the number of class labels present in this Label
instance. |
boolean |
contains(Label label)
Returns true if this label contains all values of the
specified label. |
boolean |
equals(Label o)
Indicates whether the specified Label instance is equal to
this one. |
boolean |
equals(java.lang.Object o)
|
boolean[] |
flags()
Returns the array representation of this label. |
java.lang.String |
get(int index)
Returns the class label name specified by the index. |
int |
getIndex(java.lang.String value)
Returns the index of the specified class value. |
java.util.Collection<java.lang.String> |
getValues()
Returns the collection of class label values that are set for this instance. |
int |
hashCode()
|
int |
intersect(Label another)
Returns the number of class labels that are present in both Label instances. |
int |
length()
Returns the label length. |
java.lang.String[] |
names()
Returns the names array of this label. |
Label |
toLabel(boolean[] flags)
Returns a new Label instance representing the specified
array of flags. |
Label |
toLabel(java.util.Collection<java.lang.String> labels)
Returns a new Label instance representing the specified
list of labels. |
Label |
toLabel(java.lang.String... values)
Returns a new Label instance representing the specified
array of labels. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public int length()
public Label toLabel(java.lang.String... values)
Label
instance representing the specified
array of labels.
values
- the array of labels.
Label
instance representing the specified
array of labels.public Label toLabel(java.util.Collection<java.lang.String> labels)
Label
instance representing the specified
list of labels.
labels
- the list of labels.
Label
instance representing the specified
list of labels.public Label toLabel(boolean[] flags)
Label
instance representing the specified
array of flags.
flags
- the array of flags.
Label
instance representing the specified
array of flags.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(Label o)
Label
instance is equal to
this one.
o
- the Label
instance with which to compare.
true
if this instance is the same as the
o
argument; false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Collection<java.lang.String> getValues()
public boolean active(int index)
true
is the specified class label index is active.
index
- the class label index.
true
if class label is active; false
otherwise.public boolean active(java.lang.String value)
true
is the specified class label is active.
value
- the class label.
true
if class label is active; false
otherwise.public java.lang.String get(int index)
index
- the class label index.
public int getIndex(java.lang.String value)
value
- the desired class value.
public int intersect(Label another)
Label
instances.
another
- the label to check against.
Label
instances.public int cardinality()
Label
instance.
Label
instance.public boolean contains(Label label)
true
if this label contains all values of the
specified label.
label
- the label to get the values from.
true
if this label contains all values of the
specified label; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public boolean[] flags()
public java.lang.String[] names()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |