|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.rules.Ridor
The implementation of a RIpple-DOwn Rule learner.
It generates the default rule first and then the exceptions for the default rule
with the least (weighted) error rate. Then it generates the "best" exceptions for
each exception and iterates until pure. Thus it performs a tree-like expansion of
exceptions and the leaf has only default rule but no exceptions.
The exceptions are a set of rules that predict the class other than class in default
rule. IREP is used to find out the exceptions.
There are five inner classes defined in this class.
The first is Ridor_node, which implements one node in the Ridor tree. It's basically
composed of a default class and a set of exception rules to the default class.
The second inner class is RidorRule, which implements a single exception rule
using REP.
The last three inner classes are only used in RidorRule. They are Antd, NumericAntd
and NominalAntd, which all implement a single antecedent in the RidorRule.
The Antd class is an abstract class, which has two subclasses, NumericAntd and
NominalAntd, to implement the corresponding abstract functions. These two subclasses
implement the functions related to a antecedent with a nominal attribute and a numeric
attribute respectively.
Constructor Summary | |
Ridor()
|
Method Summary | |
void |
buildClassifier(Instances instances)
Builds a ripple-down manner rule learner. |
double |
classifyInstance(Instance datum)
Classify the test instance with the rule learner |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
java.lang.String |
foldsTipText()
Returns the tip text for this property |
int |
getFolds()
|
boolean |
getMajorityClass()
|
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
double |
getMinNo()
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
int |
getSeed()
|
int |
getShuffle()
|
boolean |
getWholeDataErr()
|
java.lang.String |
globalInfo()
Returns a string describing classifier |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options Valid options are: |
static void |
main(java.lang.String[] args)
Main method. |
java.lang.String |
majorityClassTipText()
Returns the tip text for this property |
java.lang.String |
minNoTipText()
Returns the tip text for this property |
java.lang.String |
seedTipText()
Returns the tip text for this property |
void |
setFolds(int fold)
|
void |
setMajorityClass(boolean m)
|
void |
setMinNo(double m)
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSeed(int s)
|
void |
setShuffle(int sh)
|
void |
setWholeDataErr(boolean a)
|
java.lang.String |
shuffleTipText()
Returns the tip text for this property |
java.lang.String |
toString()
Prints the all the rules of the rule learner. |
java.lang.String |
wholeDataErrTipText()
Returns the tip text for this property |
Methods inherited from class weka.classifiers.Classifier |
debugTipText, distributionForInstance, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Ridor()
Method Detail |
public java.lang.String globalInfo()
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training data
java.lang.Exception
- if classifier can't be built successfullypublic double classifyInstance(Instance datum)
classifyInstance
in class Classifier
datum
- the instance to be classified
public java.util.Enumeration listOptions()
-F number
Set number of folds for reduced error pruning. One fold is
used as the pruning set. (Default: 3)
-S number
Set number of shuffles for randomization. (Default: 10)
-A
Set flag of whether use the error rate of all the data to select
the default class in each step. If not set, the learner will only use
the error rate in the pruning data
-M
Set flag of whether use the majority class as the default class
in each step instead of choosing default class based on the error rate
(if the flag is not set)
-N number
Set the minimal weights of instances within a split.
(Default: 2)
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
public java.lang.String foldsTipText()
public void setFolds(int fold)
public int getFolds()
public java.lang.String shuffleTipText()
public void setShuffle(int sh)
public int getShuffle()
public java.lang.String seedTipText()
public void setSeed(int s)
public int getSeed()
public java.lang.String wholeDataErrTipText()
public void setWholeDataErr(boolean a)
public boolean getWholeDataErr()
public java.lang.String majorityClassTipText()
public void setMajorityClass(boolean m)
public boolean getMajorityClass()
public java.lang.String minNoTipText()
public void setMinNo(double m)
public double getMinNo()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- the options for the classifier
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London