类 Ridor
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.rules.Ridor
- 所有已实现的接口:
Serializable
,Cloneable
,AdditionalMeasureProducer
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,WeightedInstancesHandler
public class Ridor
extends Classifier
implements AdditionalMeasureProducer, WeightedInstancesHandler
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. 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.
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. 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.
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)
- 版本:
- $Revision: 5529 $
- 作者:
- Xin XU (xx5@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances instances) Builds a ripple-down manner rule learner.double
classifyInstance
(Instance datum) Classify the test instance with the rule learnerReturns an enumeration of the additional measure namesReturns the tip text for this propertyReturns default capabilities of the classifier.int
getFolds()
boolean
double
getMeasure
(String additionalMeasureName) Returns the value of the named measuredouble
getMinNo()
String[]
Gets the current settings of the Classifier.Returns the revision string.int
getSeed()
int
boolean
Returns a string describing classifierReturns an enumeration describing the available options Valid options are:static void
Main method.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyvoid
setFolds
(int fold) void
setMajorityClass
(boolean m) void
setMinNo
(double m) void
setOptions
(String[] options) Parses a given list of options.void
setSeed
(int s) void
setShuffle
(int sh) void
setWholeDataErr
(boolean a) Returns the tip text for this propertytoString()
Prints the all the rules of the rule learner.Returns the tip text for this property从类继承的方法 weka.classifiers.Classifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug
-
构造器详细资料
-
Ridor
public Ridor()
-
-
方法详细资料
-
globalInfo
Returns a string describing classifier- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds a ripple-down manner rule learner.- 指定者:
buildClassifier
在类中Classifier
- 参数:
instances
- the training data- 抛出:
Exception
- if classifier can't be built successfully
-
classifyInstance
Classify the test instance with the rule learner- 覆盖:
classifyInstance
在类中Classifier
- 参数:
datum
- the instance to be classified- 返回:
- the classification
-
listOptions
Returns an enumeration describing the available options Valid options are:-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
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration of all the available options
-
setOptions
Parses a given list of options. 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)
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- an array of strings suitable for passing to setOptions
-
foldsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setFolds
public void setFolds(int fold) -
getFolds
public int getFolds() -
shuffleTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setShuffle
public void setShuffle(int sh) -
getShuffle
public int getShuffle() -
seedTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSeed
public void setSeed(int s) -
getSeed
public int getSeed() -
wholeDataErrTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setWholeDataErr
public void setWholeDataErr(boolean a) -
getWholeDataErr
public boolean getWholeDataErr() -
majorityClassTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMajorityClass
public void setMajorityClass(boolean m) -
getMajorityClass
public boolean getMajorityClass() -
minNoTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMinNo
public void setMinNo(double m) -
getMinNo
public double getMinNo() -
enumerateMeasures
Returns an enumeration of the additional measure names- 指定者:
enumerateMeasures
在接口中AdditionalMeasureProducer
- 返回:
- an enumeration of the measure names
-
getMeasure
Returns the value of the named measure- 指定者:
getMeasure
在接口中AdditionalMeasureProducer
- 参数:
additionalMeasureName
- the name of the measure to query for its value- 返回:
- the value of the named measure
- 抛出:
IllegalArgumentException
- if the named measure is not supported
-
toString
Prints the all the rules of the rule learner. -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method.- 参数:
args
- the options for the classifier
-