weka.classifiers.rules
Class FURIA.RipperRule

java.lang.Object
  extended by weka.classifiers.rules.Rule
      extended by weka.classifiers.rules.FURIA.RipperRule
All Implemented Interfaces:
java.io.Serializable, weka.core.Copyable, weka.core.RevisionHandler, weka.core.WeightedInstancesHandler
Enclosing class:
FURIA

public class FURIA.RipperRule
extends weka.classifiers.rules.Rule

This class implements a single rule that predicts specified class. A rule consists of antecedents "AND"ed together and the consequent (class value) for the classification. In this class, the Information Gain (p*[log(p/t) - log(P/T)]) is used to select an antecedent and Reduced Error Prunning (REP) with the metric of accuracy rate p/(p+n) or (TP+TN)/(P+N) is used to prune the rule.

See Also:
Serialized Form

Field Summary
 weka.core.FastVector m_Antds
          The vector of antecedents of this rule
 
Constructor Summary
FURIA.RipperRule()
          Constructor
 
Method Summary
 void calculateConfidences(weka.core.Instances data)
           
 java.lang.Object copy()
          Get a shallow copy of this rule
 double coverageDegree(weka.core.Instance datum)
          The degree of coverage instance covered by this rule
 boolean covers(weka.core.Instance datum)
          Whether the instance covered by this rule
 void findAndSetSupportBoundForKnownAntecedents(weka.core.Instances thisClassifiersExtension, boolean allWeightsAreOne)
           
 void fitAndSetCoreBound(weka.core.Instances instances)
          This function fits the rule to the data which it overlaps.
 double getConfidence()
           
 double getConsequent()
          Gets the internal representation of the class label to be predicted
 java.lang.String getRevision()
          Returns the revision string.
 void grow(weka.core.Instances data)
          Build one rule using the growing data
 boolean hasAntds()
          Whether this rule has antecedents, i.e. whether it is a default rule
 void prune(weka.core.Instances pruneData, boolean useWhole)
          Prune all the possible final sequences of the rule using the pruning data.
 void setConsequent(double cl)
          Sets the internal representation of the class label to be predicted
 double size()
          the number of antecedents of the rule
 java.lang.String toString(weka.core.Attribute classAttr)
          Prints this rule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Antds

public weka.core.FastVector m_Antds
The vector of antecedents of this rule

Constructor Detail

FURIA.RipperRule

public FURIA.RipperRule()
Constructor

Method Detail

setConsequent

public void setConsequent(double cl)
Sets the internal representation of the class label to be predicted

Parameters:
cl - the internal representation of the class label to be predicted

getConsequent

public double getConsequent()
Gets the internal representation of the class label to be predicted

Specified by:
getConsequent in class weka.classifiers.rules.Rule
Returns:
the internal representation of the class label to be predicted

copy

public java.lang.Object copy()
Get a shallow copy of this rule

Specified by:
copy in interface weka.core.Copyable
Overrides:
copy in class weka.classifiers.rules.Rule
Returns:
the copy

coverageDegree

public double coverageDegree(weka.core.Instance datum)
The degree of coverage instance covered by this rule

Parameters:
datum - the instance in question
Returns:
the degree to which the instance is covered by this rule

covers

public boolean covers(weka.core.Instance datum)
Whether the instance covered by this rule

Specified by:
covers in class weka.classifiers.rules.Rule
Parameters:
datum - the instance in question
Returns:
the boolean value indicating whether the instance is covered by this rule

hasAntds

public boolean hasAntds()
Whether this rule has antecedents, i.e. whether it is a default rule

Specified by:
hasAntds in class weka.classifiers.rules.Rule
Returns:
the boolean value indicating whether the rule has antecedents

size

public double size()
the number of antecedents of the rule

Specified by:
size in class weka.classifiers.rules.Rule
Returns:
the size of this rule

grow

public void grow(weka.core.Instances data)
          throws java.lang.Exception
Build one rule using the growing data

Specified by:
grow in class weka.classifiers.rules.Rule
Parameters:
data - the growing data used to build the rule
Throws:
java.lang.Exception - if the consequent is not set yet

prune

public void prune(weka.core.Instances pruneData,
                  boolean useWhole)
Prune all the possible final sequences of the rule using the pruning data. The measure used to prune the rule is based on flag given.

Parameters:
pruneData - the pruning data used to prune the rule
useWhole - flag to indicate whether use the error rate of the whole pruning data instead of the data covered

toString

public java.lang.String toString(weka.core.Attribute classAttr)
Prints this rule

Parameters:
classAttr - the class attribute in the data
Returns:
a textual description of this rule

fitAndSetCoreBound

public void fitAndSetCoreBound(weka.core.Instances instances)
This function fits the rule to the data which it overlaps. This way the rule can only interpolate but not extrapolate.

Parameters:
instances - The data to which the rule shall be fitted

findAndSetSupportBoundForKnownAntecedents

public void findAndSetSupportBoundForKnownAntecedents(weka.core.Instances thisClassifiersExtension,
                                                      boolean allWeightsAreOne)

calculateConfidences

public void calculateConfidences(weka.core.Instances data)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getConfidence

public double getConfidence()

getRevision

public java.lang.String getRevision()
Description copied from interface: weka.core.RevisionHandler
Returns the revision string.

Returns:
the revision