weka.classifiers
Class RuleClassifier

java.lang.Object
  |
  +--weka.classifiers.Classifier
        |
        +--weka.classifiers.RuleClassifier
All Implemented Interfaces:
Cloneable, OptionHandler, Serializable
Direct Known Subclasses:
LEM2

public abstract class RuleClassifier
extends Classifier
implements OptionHandler

See Also:
Serialized Form

Field Summary
protected  double accuracy
           
protected  double reducedSetAccuracy
           
protected  Rules rules
           
protected  String ruleStrengthOption
           
 
Constructor Summary
RuleClassifier()
           
 
Method Summary
 String accuracyTipText()
           
 double classifyInstance(Instance instance)
          Classifies a given instance.
 double getAccuracy()
          Get the value of accuracy.
 String[] getOptions()
          Gets the current settings of the Classifier.
 double getReducedSetAccuracy()
          Get the value of reducedSetAccuracy.
 String getRuleStrengthOption()
          Get the value of ruleStrengthOption.
 Enumeration listOptions()
          Returns an enumeration of all the available options.
 String reducedSetAccuracyTipText()
           
 String ruleStrengthOptionTipText()
           
 void setAccuracy(double v)
          Set the value of accuracy.
 void setOptions(String[] options)
          Parses a given list of options.
 void setReducedSetAccuracy(double v)
          Set the value of reducedSetAccuracy.
 void setRuleStrengthOption(String v)
          Set the value of ruleStrengthOption.
 
Methods inherited from class weka.classifiers.Classifier
buildClassifier, forName, makeCopies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rules

protected Rules rules

ruleStrengthOption

protected String ruleStrengthOption

accuracy

protected double accuracy

reducedSetAccuracy

protected double reducedSetAccuracy
Constructor Detail

RuleClassifier

public RuleClassifier()
Method Detail

getRuleStrengthOption

public String getRuleStrengthOption()
Get the value of ruleStrengthOption.

Returns:
value of ruleStrengthOption.

setRuleStrengthOption

public void setRuleStrengthOption(String v)
Set the value of ruleStrengthOption.

Parameters:
v - Value to assign to ruleStrengthOption.

ruleStrengthOptionTipText

public String ruleStrengthOptionTipText()

getReducedSetAccuracy

public double getReducedSetAccuracy()
Get the value of reducedSetAccuracy.

Returns:
value of reducedSetAccuracy.

setReducedSetAccuracy

public void setReducedSetAccuracy(double v)
Set the value of reducedSetAccuracy.

Parameters:
v - Value to assign to reducedSetAccuracy.

reducedSetAccuracyTipText

public String reducedSetAccuracyTipText()

getAccuracy

public double getAccuracy()
Get the value of accuracy.

Returns:
value of accuracy.

setAccuracy

public void setAccuracy(double v)
Set the value of accuracy.

Parameters:
v - Value to assign to accuracy.

accuracyTipText

public String accuracyTipText()

listOptions

public Enumeration listOptions()
Description copied from interface: OptionHandler
Returns an enumeration of all the available options.

Specified by:
listOptions in interface OptionHandler
Returns:
an enumeration of all available options

setOptions

public void setOptions(String[] options)
                throws Exception
Parses a given list of options.

Specified by:
setOptions in interface OptionHandler
Parameters:
options - the list of options as an array of strings
Throws:
Exception - if an option is not supported

getOptions

public String[] getOptions()
Gets the current settings of the Classifier.

Specified by:
getOptions in interface OptionHandler
Returns:
an array of strings suitable for passing to setOptions

classifyInstance

public double classifyInstance(Instance instance)
                        throws Exception
Classifies a given instance.

Specified by:
classifyInstance in class Classifier
Parameters:
instance - the instance to be classified
Returns:
index of the predicted class as a double if the class is nominal, otherwise the predicted value
Throws:
Exception - if instance could not be classified successfully