|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.data.Metadata
public class Metadata
This class provides attribute metadata information.
Field Summary | |
---|---|
static java.lang.String |
MISSING_VALUE
Constant value for missing attribute values. |
Constructor Summary | |
---|---|
Metadata()
Default constructor. |
Method Summary | |
---|---|
void |
add(Attribute attribute)
Adds an attribute. |
Metadata |
clone()
|
boolean |
contains(java.lang.String name)
Returns true if this metadata instance contains an
attribute with the specified name. |
boolean |
equals(Metadata o)
Compares the specified metadata object with this object for equality. |
boolean |
equals(java.lang.Object o)
|
Label |
expand(Label label)
Expands the specified class label to include all ancestor class labels according to the class hierarchy. |
Attribute |
get(int index)
|
Attribute |
get(java.lang.String attributeName)
Returns the Attribute instance given its name. |
java.util.Collection<Attribute> |
getAttributes()
Returns the collection attributes. |
ClassHierarchy |
getClassHierarchy()
|
int |
getIndex(java.lang.String attribute)
Returns the attribute index. |
Label |
getLabel()
Returns the label prototype instance. |
java.lang.String |
getName()
Returns the relation name. |
java.util.Collection<Attribute> |
getPredictor()
Returns the collection of predictor attributes. |
NominalAttribute |
getTarget()
Returns the class attribute. |
boolean |
isHierarchical()
Tests if this metadata has a class hierarchy associated. |
boolean |
isMissing(int index,
double value)
Returns true if the specified value represents a
missing value. |
boolean |
isTarget(Attribute attribute)
Returns true if the specified attribute is the class
attribute. |
void |
setClassHierarchy(ClassHierarchy hierarchy)
|
void |
setName(java.lang.String name)
Sets the relation name. |
void |
setTarget(int index)
Sets the class attribute. |
void |
setTarget(NominalAttribute attribute)
Sets the class attribute. |
net.sf.myra.framework.Graph<Term> |
toGraph()
Returns the Graph representation of this metadata instance. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MISSING_VALUE
Constructor Detail |
---|
public Metadata()
Method Detail |
---|
public void add(Attribute attribute)
attribute
- the attribute to add.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to set.public void setTarget(NominalAttribute attribute)
attribute
- the class attribute.public void setTarget(int index)
index
- the class attribute index.public NominalAttribute getTarget()
public Label getLabel()
public boolean isTarget(Attribute attribute)
true
if the specified attribute is the class
attribute.
attribute
- thee attribute to test.
true
if the specified attribute is the class
attribute; false
otherwise.public boolean contains(java.lang.String name)
true
if this metadata instance contains an
attribute with the specified name.
name
- the attribute's name.
true
if there is an attribute with the specified
name; false
otherwise.public Attribute get(java.lang.String attributeName)
Attribute
instance given its name.
attributeName
- the attribute name.
Attribute
instance given its name.public Attribute get(int index)
public int getIndex(java.lang.String attribute)
attribute
- the attribute name.
public java.util.Collection<Attribute> getAttributes()
public java.util.Collection<Attribute> getPredictor()
public ClassHierarchy getClassHierarchy()
public void setClassHierarchy(ClassHierarchy hierarchy)
hierarchy
- the hierarchy to setpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(Metadata o)
true
if the two instances have the same
attribute list and if the given instance have the class attribute
value.
o
- the metadata object to be compared for equality with this
object.
true
if the specified metadata object is equal to
this object; false
otherwise.public net.sf.myra.framework.Graph<Term> toGraph()
Graph
representation of this metadata instance.
The original Ant-Miner version only supports nominal attributes, so an
UnsupportedOperationException
is thrown if a
ContinuousAttribute
instance is found. For every nominal
attribute value, a node is added to the graph in the form attribute
= valuei.
Note that the class attribute is not included in the graph.
Graph
representation of this metadata instance.Metadata
,
Graph
public Metadata clone()
clone
in class java.lang.Object
public Label expand(Label label)
label
- the class label to be expanded.
public boolean isHierarchical()
true
if there is a class hierarchy associated;
false
otherwise.public boolean isMissing(int index, double value)
true
if the specified value represents a
missing value.
index
- the attribute index.value
- the value to check.
true
if the specified value represents a
missing value; otherwise false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |