|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.example.AbstractExampleSet
public abstract class AbstractExampleSet
Implements wrapper methods of abstract example set. Implements all
ResultObject methods.
Apart from the interface methods the implementing classes must have a public
single argument clone constructor. This constructor is invoked by reflection
from the clone method. Do not forget to call the superclass method.
| Field Summary |
|---|
| Fields inherited from interface edu.udo.cs.yale.example.ExampleSet |
|---|
ATTRIBUTE_NAME, BATCH_NAME, CLUSTER_NAME, CONFIDENCE_NAME, ID_NAME, KNOWN_ATTRIBUTE_TYPES, LABEL_NAME, PREDICTION_NAME, TYPE_ATTRIBUTE, TYPE_BATCH, TYPE_CLUSTER, TYPE_ID, TYPE_LABEL, TYPE_PREDICTION, TYPE_WEIGHT, WEIGHT_NAME |
| Constructor Summary | |
|---|---|
AbstractExampleSet()
Zero argument constructor for subclasses. |
|
AbstractExampleSet(AbstractExampleSet exampleSet)
Clone constructor. |
|
| Method Summary | |
|---|---|
void |
addAllAttributes(java.util.Collection<Attribute> c)
Adds all given attributes to this example set. |
void |
clearPredictedLabel()
Removes the predicted label. |
void |
clearWeight()
Removes the weight attribute. |
java.lang.Object |
clone()
Clones the example set by invoking a single argument clone constructor. |
boolean |
contains(Attribute attribute)
Returns true if this example set contains the given attribute. |
boolean |
containsValueType(int valueType)
Returns true if this example set contains an attribute with the given value type (see Ontology). |
IOObject |
copy()
Returns not a copy but the very same object. |
Attribute |
createClusterAttribute()
Creates a new cluster attribute of appropriate type. |
protected DataTable |
createDataTable(IOContainer container)
This method is used to create a DataTable from this example set. |
Attribute |
createSpecialAttribute(java.lang.String name,
int valueType)
Creates a new (single) special attribute with given name and value type. |
Attribute |
createWeightAttribute()
Creates a new weight attribute. |
private static boolean |
equals(Attribute a1,
Attribute a2)
Returns true iff both attributes are null or a1.equals(a2)
returns true. |
boolean |
equals(java.lang.Object o)
Returns true, if all attributes including labels and other special attributes are equal. |
java.util.List<javax.swing.Action> |
getActions()
Returns a list of all actions which can be performed for this result object. |
int |
getBlockEndIndex(int startindex)
Returns the last attribute index belonging to the block starting at startindex. |
Attribute |
getCluster()
Returns the cluster attribute. |
Attribute |
getId()
Returns the ID attribute, i.e. an attribute containing a unique integer for each example. |
Attribute |
getLabel()
Returns the label attribute used for classification and regression. |
java.lang.String |
getName()
This method overrides the implementation of ResultObjectAdapter and returns "ExampleSet". |
Attribute |
getPredictedLabel()
Returns the label predicted by some model. |
java.awt.Component |
getVisualisationComponent(IOContainer container)
Returns component with several views controlled by radio buttons. |
Attribute |
getWeight()
Returns the weight attribute. |
void |
recalculateAllAttributeStatistics()
Recalculates the attribute statistics for all attributes. |
void |
recalculateAttributeStatistics(Attribute attribute)
Recalculate the attribute statistics of the given attribute. |
void |
recalculateAttributeStatistics(java.util.List attributeList)
Here the Example Set is parsed only once, all the information is retained for each example set. |
void |
removeAllAttributes()
Removes all attributes. |
Attribute |
removeAttribute(int index)
Removes the attribute with the given index. |
void |
setAttributes(ExampleSet exampleSet)
Copies thie list of attributes from the given example set. |
void |
setCluster(Attribute cluster)
Sets the cluster attribute. |
void |
setId(Attribute idAttribute)
Sets the ID attribute. |
void |
setLabel(Attribute label)
Sets the label attribute used for classification and regression. |
void |
setPredictedLabel(Attribute predictedLabel)
Sets the predicted label. |
void |
setWeight(Attribute weight)
Seturns the weight attribute. |
java.lang.String |
toString()
|
private static void |
writeAttributeData(java.lang.String tag,
Attribute attribute,
int sourcecol,
java.io.PrintWriter aout,
boolean sparse)
Writes the data of this attribute in the given stream. |
void |
writeAttributeFile(java.io.File attFile,
java.io.File dataFile)
Writes the attribute descriptions for all examples. |
void |
writeDataFile(java.io.File dataFile)
Writes the data and the attribute description to a file. |
void |
writeSparseAttributeFile(java.io.File attFile,
java.io.File dataFile,
int format)
Writes the attribute descriptions for all examples. |
void |
writeSparseDataFile(java.io.File dataFile,
int format)
Writes the data into a sparse file format. |
| Methods inherited from class edu.udo.cs.yale.operator.ResultObjectAdapter |
|---|
addAction, toHTML, toResultString |
| Methods inherited from class edu.udo.cs.yale.operator.AbstractIOObject |
|---|
read, read, read, write, write |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.udo.cs.yale.example.ExampleSet |
|---|
addAttribute, clearUserData, getAttribute, getAttribute, getExample, getExampleFromId, getExampleReader, getExampleTable, getNumberOfAttributes, getSize, getSpecialAttribute, getSpecialAttributeNames, getSpecialAttributes, getUserData, getUserDataKeys, remapAllIds, removeAttribute, replaceAttribute, setSpecialAttribute, setUserData, size |
| Methods inherited from interface edu.udo.cs.yale.operator.ResultObject |
|---|
toResultString |
| Methods inherited from interface edu.udo.cs.yale.operator.IOObject |
|---|
write, write |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Constructor Detail |
|---|
public AbstractExampleSet()
public AbstractExampleSet(AbstractExampleSet exampleSet)
| Method Detail |
|---|
public java.lang.String getName()
getName in interface ResultObjectgetName in class ResultObjectAdapterpublic void addAllAttributes(java.util.Collection<Attribute> c)
addAllAttributes in interface ExampleSetpublic void removeAllAttributes()
ExampleSet
removeAllAttributes in interface ExampleSetpublic Attribute removeAttribute(int index)
ExampleSet
removeAttribute in interface ExampleSetpublic void setAttributes(ExampleSet exampleSet)
ExampleSet
setAttributes in interface ExampleSetpublic Attribute getLabel()
ExampleSet
getLabel in interface ExampleSetpublic void setLabel(Attribute label)
ExampleSet
setLabel in interface ExampleSetpublic Attribute getPredictedLabel()
ExampleSet
getPredictedLabel in interface ExampleSetpublic void setPredictedLabel(Attribute predictedLabel)
ExampleSet
setPredictedLabel in interface ExampleSetpublic void clearPredictedLabel()
ExampleSet
clearPredictedLabel in interface ExampleSetpublic Attribute getWeight()
ExampleSet
getWeight in interface ExampleSetpublic void setWeight(Attribute weight)
ExampleSet
setWeight in interface ExampleSetpublic void clearWeight()
ExampleSet
clearWeight in interface ExampleSetpublic Attribute getCluster()
ExampleSet
getCluster in interface ExampleSetpublic void setCluster(Attribute cluster)
ExampleSet
setCluster in interface ExampleSetpublic Attribute getId()
ExampleSet
getId in interface ExampleSetpublic void setId(Attribute idAttribute)
ExampleSet
setId in interface ExampleSetpublic Attribute createWeightAttribute()
ExampleSet
createWeightAttribute in interface ExampleSetpublic Attribute createClusterAttribute()
ExampleSet
createClusterAttribute in interface ExampleSet
public Attribute createSpecialAttribute(java.lang.String name,
int valueType)
ExampleSet
createSpecialAttribute in interface ExampleSetpublic boolean contains(Attribute attribute)
ExampleSet
contains in interface ExampleSetpublic boolean containsValueType(int valueType)
ExampleSetOntology).
containsValueType in interface ExampleSetpublic java.lang.String toString()
toString in class java.lang.Objectprotected DataTable createDataTable(IOContainer container)
DataTable from this example set. The default implementation
returns an instance of DataTableExampleSetAdapter. The given IOContainer is used to check if
there are compatible attribute weights which would used as column weights of the returned table.
Subclasses might want to override this method in order to allow for other data tables.
public java.awt.Component getVisualisationComponent(IOContainer container)
createDataTable(IOContainer)
is used.
getVisualisationComponent in interface ResultObjectgetVisualisationComponent in class ResultObjectAdapterpublic int getBlockEndIndex(int startindex)
ExampleSet
getBlockEndIndex in interface ExampleSetpublic java.util.List<javax.swing.Action> getActions()
ResultObjectAdapter
getActions in interface ResultObjectgetActions in class ResultObjectAdapter
public void writeDataFile(java.io.File dataFile)
throws java.io.IOException
ExampleSet
writeDataFile in interface ExampleSetjava.io.IOException
public void writeSparseDataFile(java.io.File dataFile,
int format)
throws java.io.IOException
writeSparseDataFile in interface ExampleSetformat - specified by SparseFormatExampleSource
java.io.IOException
public void writeAttributeFile(java.io.File attFile,
java.io.File dataFile)
throws java.io.IOException
Example.toString(). Please note that the given
data file will only be used to determine the relative position.
writeAttributeFile in interface ExampleSetjava.io.IOException
public void writeSparseAttributeFile(java.io.File attFile,
java.io.File dataFile,
int format)
throws java.io.IOException
Example.toSparseString(int format). Please note that the given data
file is only be used to determine the relative position.
writeSparseAttributeFile in interface ExampleSetformat - specified by SparseFormatExampleSource
java.io.IOException
private static void writeAttributeData(java.lang.String tag,
Attribute attribute,
int sourcecol,
java.io.PrintWriter aout,
boolean sparse)
public boolean equals(java.lang.Object o)
equals in interface ExampleSetequals in class java.lang.Object
private static boolean equals(Attribute a1,
Attribute a2)
a1.equals(a2)
returns true.
public IOObject copy()
AbstractIOObjectExampleSets) should
overwrite this method and return a proper copy.
copy in interface IOObjectcopy in class AbstractIOObjectpublic java.lang.Object clone()
clone in interface ExampleSetclone in class java.lang.Objectpublic void recalculateAllAttributeStatistics()
recalculateAttributeStatistics(List attributes) and
performs only data scan.
recalculateAllAttributeStatistics in interface ExampleSetpublic void recalculateAttributeStatistics(java.util.List attributeList)
public void recalculateAttributeStatistics(Attribute attribute)
recalculateAttributeStatistics in interface ExampleSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||