All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.experiment.CSVResultListener

java.lang.Object
    |
    +----weka.experiment.CSVResultListener

public class CSVResultListener
extends java.lang.Object
implements ResultListener, OptionHandler
CSVResultListener outputs the received results in csv format to a Writer

Version:
$Revision: 1.7 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o CSVResultListener()
 

Method Index

 o acceptResult(ResultProducer, Object[], Object[])
Just prints out each result as it is received.
 o determineColumnConstraints(ResultProducer)
Determines if there are any constraints (imposed by the destination) on the result columns to be produced by resultProducers.
 o getOptions()
Gets the current settings of the Classifier.
 o getOutputFile()
Get the value of OutputFile.
 o globalInfo()
Returns a string describing this result listener
 o isResultRequired(ResultProducer, Object[])
Always says a result is required.
 o listOptions()
Returns an enumeration describing the available options.
 o outputFileTipText()
Returns the tip text for this property
 o postProcess(ResultProducer)
Perform any postprocessing.
 o preProcess(ResultProducer)
Prepare for the results to be received.
 o setOptions(String[])
Parses a given list of options.
 o setOutputFile(File)
Set the value of OutputFile.

Constructor Detail

 o CSVResultListener
public CSVResultListener()

Method Detail

 o globalInfo
public java.lang.String globalInfo()
          Returns a string describing this result listener
Returns:
a description of the result listener suitable for displaying in the explorer/experimenter gui
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-O filename
The filename where output will be stored. Use - for stdout. (default stdout)

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
Returns:
an array of strings suitable for passing to setOptions
 o outputFileTipText
public java.lang.String outputFileTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getOutputFile
public java.io.File getOutputFile()
          Get the value of OutputFile.
Returns:
Value of OutputFile.
 o setOutputFile
public void setOutputFile(java.io.File newOutputFile)
          Set the value of OutputFile.
Parameters:
newOutputFile - Value to assign to OutputFile.
 o preProcess
public void preProcess(ResultProducer rp) throws java.lang.Exception
          Prepare for the results to be received.
Parameters:
rp - the ResultProducer that will generate the results
Throws:
java.lang.Exception - if an error occurs during preprocessing.
 o 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.
Parameters:
rp - the ResultProducer that generated the results
Throws:
java.lang.Exception - if an error occurs
 o determineColumnConstraints
public java.lang.String[] determineColumnConstraints(ResultProducer rp) throws java.lang.Exception
          Determines if there are any constraints (imposed by the destination) on the result columns to be produced by resultProducers. Null should be returned if there are NO constraints, otherwise a list of column names should be returned as an array of Strings.
Parameters:
rp - the ResultProducer to which the constraints will apply
Returns:
an array of column names to which resutltProducer's results will be restricted.
Throws:
java.lang.Exception - if an error occurs.
 o acceptResult
public void acceptResult(ResultProducer rp,
                         java.lang.Object key[],
                         java.lang.Object result[]) throws java.lang.Exception
          Just prints out each result as it is received.
Parameters:
rp - the ResultProducer that generated the result
key - The key for the results.
result - The actual results.
Throws:
java.lang.Exception - if the result could not be accepted.
 o isResultRequired
public boolean isResultRequired(ResultProducer rp,
                                java.lang.Object key[]) throws java.lang.Exception
          Always says a result is required. If this is the first call, prints out the header for the csv output.
Parameters:
rp - the ResultProducer wanting to generate the result
key - The key for which a result may be needed.
Returns:
true if the result should be calculated.
Throws:
java.lang.Exception - if it could not be determined if the result is needed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home