|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.data.Instance
public final class Instance
This class represents a instance of the dataset.
Dataset
,
Serialized FormField Summary | |
---|---|
static double |
DEFAULT_WEIGHT
The default weight of an instance. |
Method Summary | |
---|---|
boolean |
belongs(java.lang.String label)
Checks if the instance has the specified class label. |
boolean |
equals(Instance o)
Compares the specified instance with this instance for equality. |
boolean |
equals(java.lang.Object o)
|
int |
getIndex()
Returns the instance index. |
Label |
getLabel()
Returns the class label. |
Metadata |
getMetadata()
Returns the Metadata object associated with this
instance. |
java.lang.String |
getValue(Attribute attribute)
Returns the instance value for the specified attribute. |
java.lang.String |
getValue(java.lang.String name)
Returns the instance value for the specified attribute. |
java.lang.String[] |
getValues()
Returns the instance values. |
double |
getWeight()
|
int |
hashCode()
|
boolean |
isLeaf()
Verifies if this instance is associated with a leaf class label. |
boolean |
isMultilabel()
Verifies if this is a multi-label instance. |
boolean[] |
labels()
Returns the array of indexed class values (labels). |
void |
set(Attribute attribute,
java.lang.String value)
Sets the value of the specified attribute. |
void |
set(java.lang.String[] values)
Sets all attributes values. |
void |
set(java.lang.String attribute,
java.lang.String value)
Sets the value of the specified attribute. |
void |
setWeight(double weight)
|
java.lang.String |
toString()
|
double |
value(int index)
Return the (indexed) value of the specified attribute. |
double[] |
values()
Returns the array of indexed values. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_WEIGHT
Method Detail |
---|
public void set(Attribute attribute, java.lang.String value)
attribute
- the attribute to set the value.value
- the value to set.public void set(java.lang.String attribute, java.lang.String value)
attribute
- the attribute name to set the value.value
- the value to set.public void set(java.lang.String[] values)
values
- the array containing all attribute values.public int getIndex()
public java.lang.String getValue(Attribute attribute)
attribute
- the attribute object.
public java.lang.String getValue(java.lang.String name)
name
- the attribute name.
public java.lang.String[] getValues()
public double value(int index)
index
- the attribute index.
public final double[] values()
public final boolean[] labels()
public Label getLabel()
public boolean belongs(java.lang.String label)
label
- the label to check.
true
if the instance has the specified label;
false
otherwise.public Metadata getMetadata()
Metadata
object associated with this
instance.
Metadata
object associated with this
instance.public boolean isMultilabel()
true
if this is a multi-label instance;
false
otherwise.public boolean isLeaf()
true
if this instance is associated with a leaf
class label; false
otherwise.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(Instance o)
true
if the two instances have the same
Metadata
object and if the given instance have the
same values.
o
- the instance to be compared for equality with this instance.
true
if the specified instance is equal to this
instance; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public double getWeight()
public void setWeight(double weight)
weight
- the weight to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |