net.sf.myra.datamining
Class Rule

java.lang.Object
  extended by net.sf.myra.framework.Trail
      extended by net.sf.myra.framework.DefaultTrail
          extended by net.sf.myra.datamining.Rule
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ProbabilisticRule, SequentialRule

public class Rule
extends net.sf.myra.framework.DefaultTrail

This class represents a classification rule, which is built from ant tours on the problem construction graph.

Version:
$Revision$ $Date: 2008-02-08 15:54:20#$
Author:
Fernando Esteban Barril Otero
See Also:
Serialized Form

Constructor Summary
Rule(int size, Label prototype)
          Creates a new Rule instance.
Rule(Metadata metadata)
          Default constructor.
 
Method Summary
 void add(net.sf.myra.framework.Vertex<?> vertex)
           
 Rule clone()
           
 boolean equals(java.lang.Object o)
           
 Term[] getAntecedent()
          Returns the rule antecedent.
 ConfidenceFactor getConfidence()
           
 Label getConsequent()
          Returns the rule consequent.
 boolean isCovered(Instance instance)
          Checks if this rule covers the specified instance.
 void remove(net.sf.myra.framework.Vertex<?> vertex)
           
 void setConfidence(ConfidenceFactor confidence)
           
 void setConsequent(Label consequent)
          Sets the rule consequent.
 java.lang.String toString()
           
 
Methods inherited from class net.sf.myra.framework.DefaultTrail
getLast, getVertices, isEmpty
 
Methods inherited from class net.sf.myra.framework.Trail
getCost, getIteration, getSize, setCost, setIteration
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(Metadata metadata)
Default constructor.


Rule

public Rule(int size,
            Label prototype)
Creates a new Rule instance.

Parameters:
size - the maximum size of the rule antecedent.
prototype - the label prototype instance.
Method Detail

getConsequent

public Label getConsequent()
Returns the rule consequent.

Returns:
the rule consequent.

getAntecedent

public Term[] getAntecedent()
Returns the rule antecedent.

Returns:
the rule antecedent.

setConsequent

public void setConsequent(Label consequent)
Sets the rule consequent.

Parameters:
consequent - the rule consequent to set.

getConfidence

public ConfidenceFactor getConfidence()
Returns:
the confidence

setConfidence

public void setConfidence(ConfidenceFactor confidence)
Parameters:
confidence - the confidence to set

add

public void add(net.sf.myra.framework.Vertex<?> vertex)
Overrides:
add in class net.sf.myra.framework.DefaultTrail

remove

public void remove(net.sf.myra.framework.Vertex<?> vertex)
Overrides:
remove in class net.sf.myra.framework.DefaultTrail

isCovered

public boolean isCovered(Instance instance)
Checks if this rule covers the specified instance.

Parameters:
instance - the instance to check.
Returns:
true if this rule covers the specified instances; false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class net.sf.myra.framework.Trail

clone

public Rule clone()
Overrides:
clone in class net.sf.myra.framework.DefaultTrail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class net.sf.myra.framework.DefaultTrail


Copyright © 2013. All Rights Reserved.