com.rapidminer.operator.learner.rules
Class Rule

java.lang.Object
  extended by com.rapidminer.operator.learner.rules.Rule

public class Rule
extends java.lang.Object

This class combines several SplitConditions to one rule by conjunctions. For example: "if condition1 and condition2 ... and conditionN then labelname = labelValue" It provides a test method, to test if examples belong to the labelValue of this rule. The rule is build incrementally, SplitConditions may be added by addTerm

Author:
Sebastian Land, Ingo Mierswa

Constructor Summary
Rule()
           
Rule(java.lang.String labelName)
           
Rule(java.lang.String labelName, java.util.Collection<SplitCondition> terms)
           
Rule(java.lang.String labelName, SplitCondition term)
           
 
Method Summary
 void addTerm(SplitCondition condition)
          This method adds a condition to the conjunction in the rule's head
 java.lang.Object clone()
          Performs only a shallow clone on the conditions (which are not mutable).
 boolean coversExample(Example example)
           
 double[] getConfidences()
           
 ExampleSet getCovered(ExampleSet exampleSet)
           
 int[] getFrequencies()
           
 java.lang.String getLabel()
           
 java.util.List<SplitCondition> getTerms()
           
 boolean isPure(ExampleSet exampleSet, double pureness)
           
 ExampleSet removeCovered(ExampleSet exampleSet)
           
 void removeLastTerm()
           
 void setFrequencies(int[] frequencies)
           
 void setLabel(java.lang.String labelName)
           
 void setTerms(java.util.LinkedList<SplitCondition> terms)
           
 java.lang.String toString()
          This method returns a String representation of this rule.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule()

Rule

public Rule(java.lang.String labelName)

Rule

public Rule(java.lang.String labelName,
            SplitCondition term)

Rule

public Rule(java.lang.String labelName,
            java.util.Collection<SplitCondition> terms)
Method Detail

clone

public java.lang.Object clone()
Performs only a shallow clone on the conditions (which are not mutable).

Overrides:
clone in class java.lang.Object

setLabel

public void setLabel(java.lang.String labelName)

coversExample

public boolean coversExample(Example example)

setFrequencies

public void setFrequencies(int[] frequencies)

getFrequencies

public int[] getFrequencies()

getConfidences

public double[] getConfidences()

toString

public java.lang.String toString()
This method returns a String representation of this rule.

Overrides:
toString in class java.lang.Object

addTerm

public void addTerm(SplitCondition condition)
This method adds a condition to the conjunction in the rule's head

Parameters:
condition - This condition is added

removeLastTerm

public void removeLastTerm()

getTerms

public java.util.List<SplitCondition> getTerms()

setTerms

public void setTerms(java.util.LinkedList<SplitCondition> terms)

getLabel

public java.lang.String getLabel()

getCovered

public ExampleSet getCovered(ExampleSet exampleSet)

removeCovered

public ExampleSet removeCovered(ExampleSet exampleSet)

isPure

public boolean isPure(ExampleSet exampleSet,
                      double pureness)


Copyright © 2001-2009 by Rapid-I