|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.rules.Ridor
public class Ridor
An implementation of a RIpple-DOwn Rule learner.
It generates a 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.The exceptions are a set of rules that predict classes other than the default. IREP is used to generate the exceptions.
For more information about Ripple-Down Rules, see:
Brian R. Gaines, Paul Compton (1995). Induction of Ripple-Down Rules Applied to Modeling Large Databases. J. Intell. Inf. Syst.. 5(3):211-228.
Valid options are:
-F <number of folds> Set number of folds for IREP One fold is used as pruning set. (default 3)
-S <number of shuffles> Set number of shuffles to randomize the data in order to get better rule. (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 <min. weights> Set the minimal weights of instances within a split. (default 2.0)
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 |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
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. |
java.lang.String |
getRevision()
Returns the revision string. |
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, makeCopy, 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 Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the 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
-F <number of folds> Set number of folds for IREP One fold is used as pruning set. (default 3)
-S <number of shuffles> Set number of shuffles to randomize the data in order to get better rule. (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 <min. weights> Set the minimal weights of instances within a split. (default 2.0)
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 java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
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 |