类 Rule

java.lang.Object
weka.classifiers.trees.m5.Rule
所有已实现的接口:
Serializable, RevisionHandler

public class Rule extends Object implements Serializable, RevisionHandler
Generates a single m5 tree or rule
版本:
$Revision: 6260 $
作者:
Mark Hall
另请参阅:
  • 构造器详细资料

    • Rule

      public Rule()
      Constructor declaration
  • 方法详细资料

    • buildClassifier

      public void buildClassifier(Instances data) throws Exception
      Generates a single rule or m5 model tree.
      参数:
      data - set of instances serving as training data
      抛出:
      Exception - if the rule has not been generated successfully
    • classifyInstance

      public double classifyInstance(Instance instance) throws Exception
      Calculates a prediction for an instance using this rule or M5 model tree
      参数:
      instance - the instance whos class value is to be predicted
      返回:
      the prediction
      抛出:
      Exception - if a prediction can't be made.
    • topOfTree

      public RuleNode topOfTree()
      Returns the top of the tree.
    • toString

      public String toString()
      Return a description of the m5 tree or rule
      覆盖:
      toString 在类中 Object
      返回:
      a description of the m5 tree or rule as a String
    • setUnpruned

      public void setUnpruned(boolean unpruned)
      Use unpruned tree/rules
      参数:
      unpruned - true if unpruned tree/rules are to be generated
    • getUnpruned

      public boolean getUnpruned()
      Get whether unpruned tree/rules are being generated
      返回:
      true if unpruned tree/rules are to be generated
    • setUseTree

      public void setUseTree(boolean u)
      Use an m5 tree rather than generate rules
      参数:
      u - true if m5 tree is to be used
    • getUseTree

      public boolean getUseTree()
      get whether an m5 tree is being used rather than rules
      返回:
      true if an m5 tree is being used.
    • setSmoothing

      public void setSmoothing(boolean s)
      Smooth predictions
      参数:
      s - true if smoothing is to be used
    • getSmoothing

      public boolean getSmoothing()
      Get whether or not smoothing has been turned on
      返回:
      true if smoothing is being used
    • notCoveredInstances

      public Instances notCoveredInstances()
      Get the instances not covered by this rule
      返回:
      the instances not covered
    • freeNotCoveredInstances

      public void freeNotCoveredInstances()
      Free up memory consumed by the set of instances not covered by this rule.
    • getRegressionTree

      public boolean getRegressionTree()
      Get the value of regressionTree.
      返回:
      Value of regressionTree.
    • setRegressionTree

      public void setRegressionTree(boolean newregressionTree)
      Set the value of regressionTree.
      参数:
      newregressionTree - Value to assign to regressionTree.
    • setMinNumInstances

      public void setMinNumInstances(double minNum)
      Set the minumum number of instances to allow at a leaf node
      参数:
      minNum - the minimum number of instances
    • getMinNumInstances

      public double getMinNumInstances()
      Get the minimum number of instances to allow at a leaf node
      返回:
      a double value
    • getM5RootNode

      public RuleNode getM5RootNode()
    • getRevision

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