weka.experiment
Class InstancesResultListener
java.lang.Object
|
+--weka.experiment.CSVResultListener
|
+--weka.experiment.InstancesResultListener
- All Implemented Interfaces:
- OptionHandler, ResultListener, java.io.Serializable
- public class InstancesResultListener
- extends CSVResultListener
InstancesResultListener outputs the received results in arff format to
a Writer. All results must be received before the instances can be
written out.
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
- See Also:
- Serialized Form
Field Summary |
protected int[] |
m_AttributeTypes
Stores the attribute types for each column |
protected FastVector |
m_Instances
Stores the instances created so far, before assigning to a header |
protected java.util.Hashtable[] |
m_NominalIndexes
For lookup of indices given a string value for each nominal attribute |
protected FastVector[] |
m_NominalStrings
Contains strings seen so far for each nominal attribute |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_Instances
protected transient FastVector m_Instances
- Stores the instances created so far, before assigning to a header
m_AttributeTypes
protected transient int[] m_AttributeTypes
- Stores the attribute types for each column
m_NominalIndexes
protected transient java.util.Hashtable[] m_NominalIndexes
- For lookup of indices given a string value for each nominal attribute
m_NominalStrings
protected transient FastVector[] m_NominalStrings
- Contains strings seen so far for each nominal attribute
InstancesResultListener
public InstancesResultListener()
globalInfo
public java.lang.String globalInfo()
- Returns a string describing this result listener
- Overrides:
globalInfo
in class CSVResultListener
- Returns:
- a description of the result listener suitable for
displaying in the explorer/experimenter gui
preProcess
public void preProcess(ResultProducer rp)
throws java.lang.Exception
- Prepare for the results to be received.
- Overrides:
preProcess
in class CSVResultListener
- Parameters:
rp
- the ResultProducer that will generate the results- Throws:
java.lang.Exception
- if an error occurs during preprocessing.
postProcess
public void postProcess(ResultProducer rp)
throws java.lang.Exception
- Perform any postprocessing. When this method is called, it indicates
that no more results will be sent that need to be grouped together
in any way.
- Overrides:
postProcess
in class CSVResultListener
- Parameters:
rp
- the ResultProducer that generated the results- Throws:
java.lang.Exception
- if an error occurs
acceptResult
public void acceptResult(ResultProducer rp,
java.lang.Object[] key,
java.lang.Object[] result)
throws java.lang.Exception
- Collects each instance and adjusts the header information.
- Overrides:
acceptResult
in class CSVResultListener
- Parameters:
rp
- the ResultProducer that generated the resultkey
- The key for the results.result
- The actual results.- Throws:
java.lang.Exception
- if the result could not be accepted.