程序包 weka.experiment

接口 ResultProducer

所有超级接口:
Serializable
所有已知实现类:
AveragingResultProducer, CrossValidationResultProducer, DatabaseResultProducer, LearningRateResultProducer, RandomSplitResultProducer

public interface ResultProducer extends Serializable
This interface defines the methods required for an object that produces results for different randomizations of a dataset.

Possible implementations of ResultProducer:

  • Random test/train splits
  • CrossValidation splits
  • LearningCurve splits (multiple results per run?)
  • Averaging results of other result producers
版本:
$Revision: 1.7 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz)
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    doRun(int run)
    Gets the results for a specified run number.
    void
    doRunKeys(int run)
    Gets the keys for a specified run number.
    Gets a description of the internal settings of the result producer, sufficient for distinguishing a ResultProducer instance from another with different settings (ignoring those settings set through this interface).
    Gets the names of each of the key columns produced for a single run.
    Gets the data types of each of the key columns produced for a single run.
    Gets the names of each of the result columns produced for a single run.
    Gets the data types of each of the result columns produced for a single run.
    void
    Perform any postprocessing.
    void
    Prepare to generate results.
    void
    setAdditionalMeasures(String[] additionalMeasures)
    Sets a list of method names for additional measures to look for in SplitEvaluators.
    void
    Sets the dataset that results will be obtained for.
    void
    Sets the object to send results of each run to.
  • 方法详细资料

    • setInstances

      void setInstances(Instances instances)
      Sets the dataset that results will be obtained for.
      参数:
      instances - a value of type 'Instances'.
    • setResultListener

      void setResultListener(ResultListener listener)
      Sets the object to send results of each run to.
      参数:
      listener - a value of type 'ResultListener'
    • setAdditionalMeasures

      void setAdditionalMeasures(String[] additionalMeasures)
      Sets a list of method names for additional measures to look for in SplitEvaluators.
      参数:
      additionalMeasures - a list of method names
    • preProcess

      void preProcess() throws Exception
      Prepare to generate results. The ResultProducer should call preProcess(this) on the ResultListener it is to send results to.
      抛出:
      Exception - if an error occurs during preprocessing.
    • postProcess

      void postProcess() throws Exception
      Perform any postprocessing. When this method is called, it indicates that no more requests to generate results for the current experiment will be sent. The ResultProducer should call preProcess(this) on the ResultListener it is to send results to.
      抛出:
      Exception - if an error occurs
    • doRun

      void doRun(int run) throws Exception
      Gets the results for a specified run number. Different run numbers correspond to different randomizations of the data. Results produced should be sent to the current ResultListener, but only if the ResultListener says the result is required (it may already have that result). A single run may produce multiple results.
      参数:
      run - the run number to generate results for.
      抛出:
      Exception - if a problem occurs while getting the results
    • doRunKeys

      void doRunKeys(int run) throws Exception
      Gets the keys for a specified run number. Different run numbers correspond to different randomizations of the data. Keys produced should be sent to the current ResultListener
      参数:
      run - the run number to get keys for.
      抛出:
      Exception - if a problem occurs while getting the keys
    • getKeyNames

      String[] getKeyNames() throws Exception
      Gets the names of each of the key columns produced for a single run. The names should not contain spaces (use '_' instead for easy translation.)
      返回:
      an array containing the name of each key column
      抛出:
      Exception - if the key names could not be determined (perhaps because of a problem from a nested sub-resultproducer)
    • getKeyTypes

      Object[] getKeyTypes() throws Exception
      Gets the data types of each of the key columns produced for a single run.
      返回:
      an array containing objects of the type of each key column. The objects should be Strings, or Doubles.
      抛出:
      Exception - if the key types could not be determined (perhaps because of a problem from a nested sub-resultproducer)
    • getResultNames

      String[] getResultNames() throws Exception
      Gets the names of each of the result columns produced for a single run. The names should not contain spaces (use '_' instead for easy translation.)
      返回:
      an array containing the name of each result column
      抛出:
      Exception - if the result names could not be determined (perhaps because of a problem from a nested sub-resultproducer)
    • getResultTypes

      Object[] getResultTypes() throws Exception
      Gets the data types of each of the result columns produced for a single run.
      返回:
      an array containing objects of the type of each result column. The objects should be Strings, or Doubles.
      抛出:
      Exception - if the result types could not be determined (perhaps because of a problem from a nested sub-resultproducer)
    • getCompatibilityState

      String getCompatibilityState()
      Gets a description of the internal settings of the result producer, sufficient for distinguishing a ResultProducer instance from another with different settings (ignoring those settings set through this interface). For example, a cross-validation ResultProducer may have a setting for the number of folds. For a given state, the results produced should be compatible. Typically if a ResultProducer is an OptionHandler, this string will represent those command line arguments required to set the ResultProducer to that state.
      返回:
      the description of the ResultProducer state, or null if no state is defined