Package weka.experiment
Class InstancesResultListener
- java.lang.Object
-
- weka.experiment.CSVResultListener
-
- weka.experiment.InstancesResultListener
-
- All Implemented Interfaces:
java.io.Serializable,OptionHandler,RevisionHandler,ResultListener
public class InstancesResultListener extends CSVResultListener
Outputs the received results in arff format to a Writer. All results must be received before the instances can be written out. Valid options are:-O <file name> The filename where output will be stored. Use - for stdout. (default temp file)
- Version:
- $Revision: 1.11 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstancesResultListener()Sets temporary file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptResult(ResultProducer rp, java.lang.Object[] key, java.lang.Object[] result)Collects each instance and adjusts the header information.java.lang.StringgetRevision()Returns the revision string.java.lang.StringglobalInfo()Returns a string describing this result listenervoidpostProcess(ResultProducer rp)Perform any postprocessing.voidpreProcess(ResultProducer rp)Prepare for the results to be received.-
Methods inherited from class weka.experiment.CSVResultListener
determineColumnConstraints, getOptions, getOutputFile, isResultRequired, listOptions, outputFileName, outputFileTipText, setOptions, setOutputFile, setOutputFileName
-
-
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this result listener- Overrides:
globalInfoin classCSVResultListener- 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.- Specified by:
preProcessin interfaceResultListener- Overrides:
preProcessin classCSVResultListener- 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.- Specified by:
postProcessin interfaceResultListener- Overrides:
postProcessin classCSVResultListener- 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.- Specified by:
acceptResultin interfaceResultListener- Overrides:
acceptResultin classCSVResultListener- 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.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classCSVResultListener- Returns:
- the revision
-
-