|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.example.AbstractExampleTable
public abstract class AbstractExampleTable
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.
| Field Summary | |
|---|---|
private java.util.List<Attribute> |
attributes
List of instances of Attribute. |
private int |
currentlyHighestBlockNr
|
private java.util.List<java.lang.Integer> |
unusedColumnList
List of Integers referencing indices of columns that were removed, e.g. |
| Constructor Summary | |
|---|---|
AbstractExampleTable(java.util.List<Attribute> attributes)
Creates a new ExampleTable. |
|
| Method Summary | |
|---|---|
int |
addAttribute(Attribute a)
Adds the attribute to the list of attributes assigning it a free column index. |
void |
addAttributes(java.util.Collection<Attribute> newAttributes)
Adds all Attributes in newAttributes to the end
of the list of attributes, creating new data columns if necessary. |
ExampleSet |
createCompleteExampleSet(Attribute label)
Returns a new example set with all attributes switched on. |
ExampleSet |
createCompleteExampleSet(Attribute label,
Attribute predictedLabel,
Attribute weight,
Attribute idAttribute)
Returns a new example set with all attributes switched on. |
ExampleSet |
createCompleteExampleSet(java.util.Map<java.lang.String,Attribute> specialAttributes)
Returns a new example set with all attributes switched on. |
ExampleSet |
createExampleSet(AttributeSet attributeSet)
Returns a new example set with all attributes of the given attribute set. |
Attribute |
findAttribute(java.lang.String name)
Returns the attribute with the given name. |
Attribute |
getAttribute(Attribute attribute)
Returns an Attribute which is constructed in the same way as attribute. |
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 Attributes. |
int |
getBlockEndIndex(int startindex)
Returns the last attribute index belonging to the block starting at startindex. |
abstract DataRowReader |
getDataReader()
Returns an Iterator for example data given as DataRow
objects. |
abstract DataRow |
getDataRow(int index)
Returns the i-th data row. |
int |
getHighestBlockNr()
Gets the currently highest used block number. |
int |
getNextFreeBlockNr()
Returns a new unused blockNr. |
int |
getNumberOfAttributes()
Returns the number of attributes. |
abstract int |
getSize()
Returns the number of examples. |
void |
removeAttribute(Attribute attribute)
Equivalent to calling removeAttribute(attribute.getTableIndex()). |
void |
removeAttribute(int index)
Sets the attribute with the given index to null. |
java.lang.String |
toDataString()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int currentlyHighestBlockNr
private java.util.List<Attribute> attributes
Attribute. The i-th entry in the
list belongs to the i-th data column. Whenever attributes are
removed from the list of attributes (e.g. they were intermediate
predicted labels used only within a validation chain), the succeeding
entries do not move up, but the entry is replaced by a null entry and
this index is added to unusedColumnList as an
Integer.
private java.util.List<java.lang.Integer> unusedColumnList
| Constructor Detail |
|---|
public AbstractExampleTable(java.util.List<Attribute> attributes)
attributes - List of Attribute. The indices of the attibutes are
set to values reflecting their position in the list.| Method Detail |
|---|
public abstract int getSize()
getSize in interface ExampleTablepublic abstract DataRowReader getDataReader()
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).
getDataReader in interface ExampleTablepublic abstract DataRow getDataRow(int index)
getDataRow in interface ExampleTablepublic Attribute[] getAttributes()
Attributes.
getAttributes in interface ExampleTablepublic Attribute getAttribute(int i)
getAttribute in interface ExampleTable
public Attribute findAttribute(java.lang.String name)
throws OperatorException
findAttribute in interface ExampleTableOperatorExceptionpublic void addAttributes(java.util.Collection<Attribute> newAttributes)
Attributes in newAttributes to the end
of the list of attributes, creating new data columns if necessary.
addAttributes in interface ExampleTablepublic int addAttribute(Attribute a)
addAttribute in interface ExampleTablepublic void removeAttribute(Attribute attribute)
removeAttribute(attribute.getTableIndex()).
removeAttribute in interface ExampleTablepublic void removeAttribute(int index)
removeAttribute in interface ExampleTablepublic int getNumberOfAttributes()
Attributes by calling
getAttribute(int) must keep in mind, that some of
these attributes may be null.
getNumberOfAttributes in interface ExampleTablepublic int getAttributeCount()
getAttributeCount in interface ExampleTableExampleTable.getNumberOfAttributes().public int getHighestBlockNr()
getHighestBlockNr in interface ExampleTablepublic int getNextFreeBlockNr()
getNextFreeBlockNr in interface ExampleTablepublic int getBlockEndIndex(int startindex)
getBlockEndIndex in interface ExampleTablepublic Attribute getAttribute(Attribute attribute)
attribute. Attention:
getAttribute in interface ExampleTablepublic ExampleSet createExampleSet(AttributeSet attributeSet)
createExampleSet in interface ExampleTablepublic ExampleSet createCompleteExampleSet(Attribute label)
public ExampleSet createCompleteExampleSet(Attribute label,
Attribute predictedLabel,
Attribute weight,
Attribute idAttribute)
createCompleteExampleSet in interface ExampleTablepublic ExampleSet createCompleteExampleSet(java.util.Map<java.lang.String,Attribute> specialAttributes)
createCompleteExampleSet in interface ExampleTablepublic java.lang.String toString()
toString in interface ExampleTabletoString in class java.lang.Objectpublic java.lang.String toDataString()
toDataString in interface ExampleTable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||