|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExampleTable
This class is the core data supplier for example sets. Several example sets
can use the same data and access the attribute values by reference. Thats means
that ExampleTable contains all data like in a database management systems and
all ExampleSet
s are only views on the data. The ExampleSets themself
do hence not contain any data rows and can be cloned without copying the data.
Changing the data in the ExampleTable will change the data for all views (ExampleSets).
On the other hand, the changes for one view (ExampleSet) like adding or removing Attribute
s
will not change the ExampleTable and will also not change other views (ExampleSets).
Method Summary | |
---|---|
int |
addAttribute(Attribute a)
Adds a clone of the attribute a to the list of attributes assigning it a free column
index. |
void |
addAttributes(java.util.Collection<Attribute> newAttributes)
Adds all Attribute s in newAttributes to the end
of the list of attributes, creating new data columns if necessary. |
ExampleSet |
createExampleSet()
Returns a new example set with all attributes switched on. |
ExampleSet |
createExampleSet(Attribute labelAttribute)
Returns a new example set with all attributes switched on. |
ExampleSet |
createExampleSet(Attribute labelAttribute,
Attribute weightAttribute,
Attribute idAttribute)
Returns a new example set with all attributes switched on. |
ExampleSet |
createExampleSet(AttributeSet attributeSet)
Returns a new example set with all attributes of the ExampleTable
and with the special roles defined by the given attribute set. |
ExampleSet |
createExampleSet(java.util.Iterator<AttributeRole> newSpecialAttributes)
|
ExampleSet |
createExampleSet(java.util.Map<Attribute,java.lang.String> specialAttributes)
Returns a new example set with all attributes switched on. |
Attribute |
findAttribute(java.lang.String name)
Returns the attribute with the given name. |
Attribute |
getAttribute(int i)
Returns the attribute of the column number i. |
int |
getAttributeCount()
Returns the number of non null attributes. |
Attribute[] |
getAttributes()
Returns a new array containing all Attribute s. |
DataRow |
getDataRow(int index)
Returns the i-th data row. |
DataRowReader |
getDataRowReader()
Returns an Iterator for example data given as DataRow
objects. |
int |
getNumberOfAttributes()
Returns the number of attributes. |
void |
removeAttribute(Attribute attribute)
Equivalent to calling removeAttribute(attribute.getTableIndex()) . |
void |
removeAttribute(int index)
Sets the attribute with the given index to null. |
int |
size()
Returns the number of examples. |
java.lang.String |
toDataString()
Dumps the complete data as string. |
java.lang.String |
toString()
Returns a string representation of this example table. |
Method Detail |
---|
int size()
DataRowReader getDataRowReader()
DataRow
objects. This should be used in all cases where iteration is desired.
Since getDataRow(int)
does not ensure to work in an efficient
way the usage of this method is preferred (instead using for-loops).
DataRow getDataRow(int index)
Attribute[] getAttributes()
Attribute
s.
Attribute getAttribute(int i)
Attribute findAttribute(java.lang.String name) throws OperatorException
OperatorException
void addAttributes(java.util.Collection<Attribute> newAttributes)
Attribute
s in newAttributes
to the end
of the list of attributes, creating new data columns if necessary.
int addAttribute(Attribute a)
a
to the list of attributes assigning it a free column
index.
The column index is also set on a
.
void removeAttribute(Attribute attribute)
removeAttribute(attribute.getTableIndex())
.
void removeAttribute(int index)
int getNumberOfAttributes()
Attribute
s by calling
AbstractExampleTable.getAttribute(int)
must keep in mind, that some of
these attributes may be null.
int getAttributeCount()
getNumberOfAttributes().
ExampleSet createExampleSet(Attribute labelAttribute)
ExampleSet createExampleSet(java.util.Iterator<AttributeRole> newSpecialAttributes)
ExampleSet createExampleSet(Attribute labelAttribute, Attribute weightAttribute, Attribute idAttribute)
ExampleSet createExampleSet(AttributeSet attributeSet)
ExampleTable
and with the special roles defined by the given attribute set.
ExampleSet createExampleSet(java.util.Map<Attribute,java.lang.String> specialAttributes)
ExampleSet createExampleSet()
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String toDataString()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |