类 JRip.RipperRule

java.lang.Object
weka.classifiers.rules.Rule
weka.classifiers.rules.JRip.RipperRule
所有已实现的接口:
Serializable, Copyable, RevisionHandler, WeightedInstancesHandler
封闭类:
JRip

public class JRip.RipperRule extends Rule
This class implements a single rule that predicts specified class. A rule consists of antecedents "AND"ed together and the consequent (class value) for the classification. In this class, the Information Gain (p*[log(p/t) - log(P/T)]) is used to select an antecedent and Reduced Error Prunning (REP) with the metric of accuracy rate p/(p+n) or (TP+TN)/(P+N) is used to prune the rule.
另请参阅:
  • 构造器详细资料

    • RipperRule

      public RipperRule()
      Constructor
  • 方法详细资料

    • setConsequent

      public void setConsequent(double cl)
      Sets the internal representation of the class label to be predicted
      参数:
      cl - the internal representation of the class label to be predicted
    • getConsequent

      public double getConsequent()
      Gets the internal representation of the class label to be predicted
      指定者:
      getConsequent 在类中 Rule
      返回:
      the internal representation of the class label to be predicted
    • copy

      public Object copy()
      Get a shallow copy of this rule
      指定者:
      copy 在接口中 Copyable
      覆盖:
      copy 在类中 Rule
      返回:
      the copy
    • covers

      public boolean covers(Instance datum)
      Whether the instance covered by this rule
      指定者:
      covers 在类中 Rule
      参数:
      datum - the instance in question
      返回:
      the boolean value indicating whether the instance is covered by this rule
    • hasAntds

      public boolean hasAntds()
      Whether this rule has antecedents, i.e. whether it is a default rule
      指定者:
      hasAntds 在类中 Rule
      返回:
      the boolean value indicating whether the rule has antecedents
    • getAntds

      public FastVector getAntds()
      Return the antecedents
      返回:
      the vector of antecedents
    • size

      public double size()
      the number of antecedents of the rule
      指定者:
      size 在类中 Rule
      返回:
      the size of this rule
    • grow

      public void grow(Instances data) throws Exception
      Build one rule using the growing data
      指定者:
      grow 在类中 Rule
      参数:
      data - the growing data used to build the rule
      抛出:
      Exception - if the consequent is not set yet
    • prune

      public void prune(Instances pruneData, boolean useWhole)
      Prune all the possible final sequences of the rule using the pruning data. The measure used to prune the rule is based on flag given.
      参数:
      pruneData - the pruning data used to prune the rule
      useWhole - flag to indicate whether use the error rate of the whole pruning data instead of the data covered
    • toString

      public String toString(Attribute classAttr)
      Prints this rule
      参数:
      classAttr - the class attribute in the data
      返回:
      a textual description of this rule
    • getRevision

      public String getRevision()
      Returns the revision string.
      返回:
      the revision