类 OneR

java.lang.Object
weka.classifiers.Classifier
weka.classifiers.rules.OneR
所有已实现的接口:
Serializable, Cloneable, Sourcable, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

public class OneR extends Classifier implements TechnicalInformationHandler, Sourcable
Class for building and using a 1R classifier; in other words, uses the minimum-error attribute for prediction, discretizing numeric attributes. For more information, see:

R.C. Holte (1993). Very simple classification rules perform well on most commonly used datasets. Machine Learning. 11:63-91.

BibTeX:

 @article{Holte1993,
    author = {R.C. Holte},
    journal = {Machine Learning},
    pages = {63-91},
    title = {Very simple classification rules perform well on most commonly used datasets},
    volume = {11},
    year = {1993}
 }
 

Valid options are:

 -B <minimum bucket size>
  The minimum number of objects in a bucket (default: 6).
版本:
$Revision: 9918 $
作者:
Ian H. Witten (ihw@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • OneR

      public OneR()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description suitable for displaying in the explorer/experimenter gui
    • getTechnicalInformation

      public TechnicalInformation getTechnicalInformation()
      Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
      指定者:
      getTechnicalInformation 在接口中 TechnicalInformationHandler
      返回:
      the technical information about this class
    • classifyInstance

      public double classifyInstance(Instance inst) throws Exception
      Classifies a given instance.
      覆盖:
      classifyInstance 在类中 Classifier
      参数:
      inst - the instance to be classified
      返回:
      the classification of the instance
      抛出:
      Exception - if an error occurred during the prediction
    • getCapabilities

      public Capabilities getCapabilities()
      Returns default capabilities of the classifier.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 Classifier
      返回:
      the capabilities of this classifier
      另请参阅:
    • buildClassifier

      public void buildClassifier(Instances instances) throws Exception
      Generates the classifier.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      instances - the instances to be used for building the classifier
      抛出:
      Exception - if the classifier can't be built successfully
    • newRule

      public weka.classifiers.rules.OneR.OneRRule newRule(Attribute attr, Instances data) throws Exception
      Create a rule branching on this attribute.
      参数:
      attr - the attribute to branch on
      data - the data to be used for creating the rule
      返回:
      the generated rule
      抛出:
      Exception - if the rule can't be built successfully
    • newNominalRule

      public weka.classifiers.rules.OneR.OneRRule newNominalRule(Attribute attr, Instances data, int[] missingValueCounts) throws Exception
      Create a rule branching on this nominal attribute.
      参数:
      attr - the attribute to branch on
      data - the data to be used for creating the rule
      missingValueCounts - to be filled in
      返回:
      the generated rule
      抛出:
      Exception - if the rule can't be built successfully
    • newNumericRule

      public weka.classifiers.rules.OneR.OneRRule newNumericRule(Attribute attr, Instances data, int[] missingValueCounts) throws Exception
      Create a rule branching on this numeric attribute
      参数:
      attr - the attribute to branch on
      data - the data to be used for creating the rule
      missingValueCounts - to be filled in
      返回:
      the generated rule
      抛出:
      Exception - if the rule can't be built successfully
    • listOptions

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

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

      Valid options are:

       -B <minimum bucket size>
        The minimum number of objects in a bucket (default: 6).
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Classifier
      参数:
      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 OneR classifier.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      an array of strings suitable for passing to setOptions
    • toSource

      public String toSource(String className) throws Exception
      Returns a string that describes the classifier as source. The classifier will be contained in a class with the given name (there may be auxiliary classes), and will contain a method with the signature:
      
       public static double classify(Object[] i);
       
      where the array i contains elements that are either Double, String, with missing values represented as null. The generated code is public domain and comes with no warranty.
      指定者:
      toSource 在接口中 Sourcable
      参数:
      className - the name that should be given to the source class.
      返回:
      the object source described by a string
      抛出:
      Exception - if the souce can't be computed
    • toString

      public String toString()
      Returns a description of the classifier
      覆盖:
      toString 在类中 Object
      返回:
      a string representation of the classifier
    • minBucketSizeTipText

      public String minBucketSizeTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getMinBucketSize

      public int getMinBucketSize()
      Get the value of minBucketSize.
      返回:
      Value of minBucketSize.
    • setMinBucketSize

      public void setMinBucketSize(int v)
      Set the value of minBucketSize.
      参数:
      v - Value to assign to minBucketSize.
    • getRevision

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

      public static void main(String[] argv)
      Main method for testing this class
      参数:
      argv - the commandline options