com.rapidminer.example.set
Class SimpleExampleSet

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.example.set.AbstractExampleSet
              extended by com.rapidminer.example.set.SimpleExampleSet
All Implemented Interfaces:
ExampleSet, IOObject, ResultObject, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Example>

public class SimpleExampleSet
extends AbstractExampleSet

A simple implementation of ExampleSet containing a list of attributes and a special attribute map. The data is queried from an example table which contains the data (example sets actually are only views on this table and does not keep any data). This simple example set implementation usually is the basic example set of the multi-layered data view.

Author:
Ingo Mierswa, Simon Fischer Exp $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject
AbstractIOObject.InputStreamProvider
 
Constructor Summary
SimpleExampleSet(ExampleTable exampleTable)
          Constructs a new SimpleExampleSet backed by the given example table.
SimpleExampleSet(ExampleTable exampleTable, java.util.List<Attribute> regularAttributes)
          Constructs a new SimpleExampleSet backed by the given example table.
SimpleExampleSet(ExampleTable exampleTable, java.util.List<Attribute> regularAttributes, java.util.Map<Attribute,java.lang.String> specialAttributes)
          Constructs a new SimpleExampleSet backed by the given example table.
SimpleExampleSet(ExampleTable exampleTable, java.util.Map<Attribute,java.lang.String> specialAttributes)
          Constructs a new SimpleExampleSet backed by the given example table.
SimpleExampleSet(SimpleExampleSet exampleSet)
          Clone constructor.
 
Method Summary
 Attributes getAttributes()
          Returns the data structure holding all attributes.
 Example getExample(int index)
          Returns the i-th example.
 ExampleTable getExampleTable()
          Returns the underlying example table.
 java.util.Iterator<Example> iterator()
           
 int size()
          Returns the number of examples in this example set.
 
Methods inherited from class com.rapidminer.example.set.AbstractExampleSet
clone, copy, createDataTable, equals, getExampleFromId, getExampleIndicesFromId, getExtension, getFileDescription, getName, getStatistics, getStatistics, hashCode, recalculateAllAttributeStatistics, recalculateAttributeStatistics, remapIds, toString, writeAttributeFile, writeDataFile, writeSparseAttributeFile, writeSparseDataFile
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, getAnnotations, getResultIcon, log, log, logError, logNote, logWarning, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
appendOperatorToHistory, getLog, getProcessingHistory, getSource, initWriting, read, read, read, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.ResultObject
getActions, getResultIcon, toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
appendOperatorToHistory, getAnnotations, getLog, getProcessingHistory, getSource, setLoggingHandler, setSource, write
 

Constructor Detail

SimpleExampleSet

public SimpleExampleSet(ExampleTable exampleTable)
Constructs a new SimpleExampleSet backed by the given example table. The example set initially does not have any special attributes but all attributes from the given table will be used as regular attributes. If you are constructing the example set from a MemoryExampleTable, you should use the method AbstractExampleTable.createExampleSet() instead unless you are absolutely sure what you are doing.


SimpleExampleSet

public SimpleExampleSet(ExampleTable exampleTable,
                        java.util.List<Attribute> regularAttributes)
Constructs a new SimpleExampleSet backed by the given example table. The example set initially does not have any special attributes but all attributes from the given table will be used as regular attributes. If you are constructing the example set from a MemoryExampleTable, you should use the method AbstractExampleTable.createExampleSet() instead unless you are absolutely sure what you are doing.


SimpleExampleSet

public SimpleExampleSet(ExampleTable exampleTable,
                        java.util.Map<Attribute,java.lang.String> specialAttributes)
Constructs a new SimpleExampleSet backed by the given example table. All attributes in the table apart from the special attributes become normal (regular) attributes. The special attributes are specified by the given map. If you are constructing the example set from a MemoryExampleTable, you should use the method AbstractExampleTable.createExampleSet(Map) instead unless you are absolutely sure what you are doing.


SimpleExampleSet

public SimpleExampleSet(ExampleTable exampleTable,
                        java.util.List<Attribute> regularAttributes,
                        java.util.Map<Attribute,java.lang.String> specialAttributes)
Constructs a new SimpleExampleSet backed by the given example table. All attributes in the table defined in the regular attribute list apart from those (also) defined the special attributes become normal (regular) attributes. The special attributes are specified by the given map. If you are constructing the example set from a MemoryExampleTable, you should use the method AbstractExampleTable.createExampleSet(Map) instead unless you are absolutely sure what you are doing.


SimpleExampleSet

public SimpleExampleSet(SimpleExampleSet exampleSet)
Clone constructor. The example table is copied by reference, the attributes are copied by a deep clone. Don't use this method directly but use the clone method instead.

Method Detail

getAttributes

public Attributes getAttributes()
Description copied from interface: ExampleSet
Returns the data structure holding all attributes.


getExampleTable

public ExampleTable getExampleTable()
Description copied from interface: ExampleSet
Returns the underlying example table. Most operators should operate on the example set and manipulate example to change table data instead of using the table directly.


size

public int size()
Description copied from interface: ExampleSet
Returns the number of examples in this example set. This number should not be used to create for-loops to iterate through all examples.


getExample

public Example getExample(int index)
Description copied from interface: ExampleSet
Returns the i-th example. It is not guaranteed that asking for an example by using the index in the example table is efficiently implemented. Therefore for-loops for iterations are not an option and an ExampleReader should be used.


iterator

public java.util.Iterator<Example> iterator()


Copyright © 2001-2009 by Rapid-I