程序包 weka.experiment
类 CSVResultListener
java.lang.Object
weka.experiment.CSVResultListener
- 所有已实现的接口:
Serializable
,OptionHandler
,RevisionHandler
,ResultListener
- 直接已知子类:
InstancesResultListener
public class CSVResultListener
extends Object
implements ResultListener, OptionHandler, RevisionHandler
Takes results from a result producer and assembles them into comma separated value form.
Valid options are:
-O <file name> The filename where output will be stored. Use - for stdout. (default temp file)
- 版本:
- $Revision: 1.13 $
- 作者:
- Len Trigg (trigg@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
acceptResult
(ResultProducer rp, Object[] key, Object[] result) Just prints out each result as it is received.String[]
Determines if there are any constraints (imposed by the destination) on the result columns to be produced by resultProducers.String[]
Gets the current settings of the Classifier.Get the value of OutputFile.Returns the revision string.Returns a string describing this result listenerboolean
isResultRequired
(ResultProducer rp, Object[] key) Always says a result is required.Returns an enumeration describing the available options..Get the value of OutputFileName.Returns the tip text for this propertyvoid
Perform any postprocessing.void
Prepare for the results to be received.void
setOptions
(String[] options) Parses a given list of options.void
setOutputFile
(File newOutputFile) Set the value of OutputFile.void
setOutputFileName
(String name) Set the value of OutputFileName.
-
构造器详细资料
-
CSVResultListener
public CSVResultListener()Sets temporary file.
-
-
方法详细资料
-
globalInfo
Returns a string describing this result listener- 返回:
- a description of the result listener suitable for displaying in the explorer/experimenter gui
-
listOptions
Returns an enumeration describing the available options..- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-O <file name> The filename where output will be stored. Use - for stdout. (default temp file)
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Classifier.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
-
outputFileTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getOutputFile
Get the value of OutputFile.- 返回:
- Value of OutputFile.
-
setOutputFile
Set the value of OutputFile. Also sets the OutputFileName.- 参数:
newOutputFile
- Value to assign to OutputFile.
-
outputFileName
Get the value of OutputFileName.- 返回:
- Value of OutputFile.
-
setOutputFileName
Set the value of OutputFileName. Must be used AFTER setOutputFile.- 参数:
name
- the name of OutputFile.
-
preProcess
Prepare for the results to be received.- 指定者:
preProcess
在接口中ResultListener
- 参数:
rp
- the ResultProducer that will generate the results- 抛出:
Exception
- if an error occurs during preprocessing.
-
postProcess
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.- 指定者:
postProcess
在接口中ResultListener
- 参数:
rp
- the ResultProducer that generated the results- 抛出:
Exception
- if an error occurs
-
determineColumnConstraints
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.- 指定者:
determineColumnConstraints
在接口中ResultListener
- 参数:
rp
- the ResultProducer to which the constraints will apply- 返回:
- an array of column names to which resutltProducer's results will be restricted.
- 抛出:
Exception
- if an error occurs.
-
acceptResult
Just prints out each result as it is received.- 指定者:
acceptResult
在接口中ResultListener
- 参数:
rp
- the ResultProducer that generated the resultkey
- The key for the results.result
- The actual results.- 抛出:
Exception
- if the result could not be accepted.
-
isResultRequired
Always says a result is required. If this is the first call, prints out the header for the csv output.- 指定者:
isResultRequired
在接口中ResultListener
- 参数:
rp
- the ResultProducer wanting to generate the resultkey
- The key for which a result may be needed.- 返回:
- true if the result should be calculated.
- 抛出:
Exception
- if it could not be determined if the result is needed.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-