weka.associations.tertius
Class Head

java.lang.Object
  extended byweka.associations.tertius.LiteralSet
      extended byweka.associations.tertius.Head
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Head
extends LiteralSet

Class representing the head of a rule.

Author:
Amélie Deltour
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.associations.tertius.LiteralSet
 
Constructor Summary
Head()
          Constructor without storing the counter-instances.
Head(Instances instances)
          Constructor storing the counter-instances.
 
Method Summary
 boolean canKeep(Instance instance, Literal newLit)
          Test if an instance can be kept as a counter-instance, if a new literal is added to this head.
 boolean isIncludedIn(Rule otherRule)
          Test if this Head is included in a rule.
 java.lang.String toString()
          Gives a String representation of this set of literals as a disjunction.
 
Methods inherited from class weka.associations.tertius.LiteralSet
addElement, clone, contains, counterInstance, counterInstance, enumerateLiterals, getCounterInstancesFrequency, getCounterInstancesNumber, getLastLiteral, getType, hasMaxCounterInstances, isEmpty, negationIncludedIn, numLiterals, overFrequencyThreshold, upDate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Head

public Head()
Constructor without storing the counter-instances.


Head

public Head(Instances instances)
Constructor storing the counter-instances.

Parameters:
instances - The dataset.
Method Detail

canKeep

public boolean canKeep(Instance instance,
                       Literal newLit)
Test if an instance can be kept as a counter-instance, if a new literal is added to this head.

Specified by:
canKeep in class LiteralSet
Parameters:
instance - The instance to test.
newLit - The new literal.
Returns:
True if the instance is still a counter-instance (if the negation of the new literal satisfies the instance).

isIncludedIn

public boolean isIncludedIn(Rule otherRule)
Test if this Head is included in a rule. It is the literals of this Head are contained in the head of the other rule, or if their negation is included in the body of the other rule.

Specified by:
isIncludedIn in class LiteralSet
Parameters:
otherRule - The rule to test.
Returns:
True if this set of literals is included in the rule.

toString

public java.lang.String toString()
Gives a String representation of this set of literals as a disjunction.

Specified by:
toString in class LiteralSet