All Packages Class Hierarchy This Package Previous Next Index WEKA's home
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.rules.ConjunctiveRule
A rule consists of antecedents "AND"ed together and the consequent (class value)
for the classification/regression. In this case, the consequent is the
distribution of the available classes (or numeric value) in the dataset.
If the test instance is not covered by this rule, then it's predicted
using the default class distributions/value of the data not covered by the
rule in the training data.
This learner selects an antecedent by computing the Information Gain of each
antecendent and prunes the generated rule using Reduced Error Prunning (REP).
For classification, the Information of one antecedent is the weighted average of
the entropies of both the data covered and not covered by the rule.
For regression, the Information is the weighted average of the mean-squared errors
of both the data covered and not covered by the rule.
In pruning, weighted average of accuracy rate of the pruning data is used for classification while the weighted average of the mean-squared errors of the pruning data is used for regression.
-N number
Set number of folds for REP.
public ConjunctiveRule()
public java.util.Enumeration listOptions()
-N number
Set number of folds for REP. One fold is
used as the pruning set. (Default: 3)
-R
Set if NOT randomize the data before split to growing and
pruning data. If NOT set, the seed of randomization is
specified by the -S option. (Default: randomize)
-S
Seed of randomization. (Default: 1)
-E
Set whether consider the exclusive expressions for nominal
attribute split. (Default: false)
-M number
Set the minimal weights of instances within a split.
(Default: 2)
-P number
Set the number of antecedents allowed in the rule if pre-pruning
is used. If this value is other than -1, then pre-pruning will be
used, otherwise the rule uses REP. (Default: -1)
public void setOptions(java.lang.String options[]) throws java.lang.Exception
options - the list of options as an array of strings
public java.lang.String[] getOptions()
public void setFolds(int folds)
public int getFolds()
public void setSeed(long s)
public long getSeed()
public boolean getRandomized()
public void setRandomized(boolean r)
public boolean getExclusive()
public void setExclusive(boolean e)
public void setMinNo(double m)
public double getMinNo()
public void setNumAntds(int n)
public int getNumAntds()
public void buildClassifier(Instances instances) throws java.lang.Exception
instances - the training data
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
instance - the instance for which distribution is to be computed
public boolean isCover(Instance datum)
inst - the instance in question
public boolean hasAntds()
public java.lang.String toString(java.lang.String att,
java.lang.String cl)
att - the string standing for attribute in the consequent of this rule
cl - the string standing for value in the consequent of this rule
public java.lang.String toString()
public static void main(java.lang.String args[])
args - the options for the classifier
All Packages Class Hierarchy This Package Previous Next Index WEKA's home