Class Rule
java.lang.Object
weka.classifiers.rules.Rule
- All Implemented Interfaces:
Serializable, Copyable, RevisionHandler, WeightedInstancesHandler
- Direct Known Subclasses:
JRip.RipperRule
public abstract class Rule
extends Object
implements WeightedInstancesHandler, Copyable, Serializable, RevisionHandler
Abstract class of generic rule
- Version:
- $Revision: 1.8 $
- Author:
- Xin Xu (xx5@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Get a shallow copy of this ruleabstract booleanWhether the instance covered by this ruleabstract doubleGet the consequent of this rule, i.e.abstract voidBuild this ruleabstract booleanhasAntds()Whether this rule has antecedents, i.e.abstract doublesize()The size of the rule.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RevisionHandler
getRevision
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
copy
-
covers
Whether the instance covered by this rule- Parameters:
datum- the instance in question- Returns:
- the boolean value indicating whether the instance is covered by this rule
-
grow
-
hasAntds
public abstract boolean hasAntds()Whether this rule has antecedents, i.e. whether it is a default rule- Returns:
- the boolean value indicating whether the rule has antecedents
-
getConsequent
public abstract double getConsequent()Get the consequent of this rule, i.e. the predicted class- Returns:
- the consequent
-
size
public abstract double size()The size of the rule. Could be number of antecedents in the case of conjunctive rule- Returns:
- the size of the rule
-