程序包 weka.classifiers

类 CheckSource

java.lang.Object
weka.classifiers.CheckSource
所有已实现的接口:
OptionHandler, RevisionHandler

public class CheckSource extends Object implements OptionHandler, RevisionHandler
A simple class for checking the source generated from Classifiers implementing the weka.classifiers.Sourcable interface. It takes a classifier, the classname of the generated source and the dataset the source was generated with as parameters and tests the output of the built classifier against the output of the generated source. Use option '-h' to display all available commandline options. Valid options are:

 -W <classname and options>
  The classifier (incl. options) that was used to generate
  the source code.
 -S <classname>
  The classname of the generated source code.
 -t <file>
  The training set with which the source code was generated.
 -c <index>
  The class index of the training set. 'first' and 'last' are
  valid indices.
  (default: last)
Options after -- are passed to the designated classifier (specified with -W).
版本:
$Revision: 1.4 $
作者:
fracpete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • CheckSource

      public CheckSource()
  • 方法详细资料

    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.

      Valid options are:

       -W <classname and options>
        The classifier (incl. options) that was used to generate
        the source code.
       -S <classname>
        The classname of the generated source code.
       -t <file>
        The training set with which the source code was generated.
       -c <index>
        The class index of the training set. 'first' and 'last' are
        valid indices.
        (default: last)
      Options after -- are passed to the designated classifier (specified with -W).
      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the Classifier.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions
    • setClassifier

      public void setClassifier(Classifier value)
      Sets the classifier to use for the comparison.
      参数:
      value - the classifier to use
    • getClassifier

      public Classifier getClassifier()
      Gets the classifier being used for the tests, can be null.
      返回:
      the currently set classifier
    • setSourceCode

      public void setSourceCode(Classifier value)
      Sets the class to test.
      参数:
      value - the class to test
    • getSourceCode

      public Classifier getSourceCode()
      Gets the class to test.
      返回:
      the currently set class, can be null.
    • setDataset

      public void setDataset(File value)
      Sets the dataset to use for testing.
      参数:
      value - the dataset to use.
    • getDataset

      public File getDataset()
      Gets the dataset to use for testing, can be null.
      返回:
      the dataset to use.
    • setClassIndex

      public void setClassIndex(int value)
      Sets the class index of the dataset.
      参数:
      value - the class index of the dataset.
    • getClassIndex

      public int getClassIndex()
      Gets the class index of the dataset.
      返回:
      the current class index.
    • execute

      public boolean execute() throws Exception
      performs the comparison test
      返回:
      true if tests were successful
      抛出:
      Exception - if tests fail
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision
    • main

      public static void main(String[] args) throws Exception
      Executes the tests, use "-h" to list the commandline options.
      参数:
      args - the commandline parameters
      抛出:
      Exception - if something goes wrong