public class ConjunctiveRule
extends weka.classifiers.AbstractClassifier
implements weka.core.OptionHandler, weka.core.WeightedInstancesHandler
-N <number of folds> Set number of folds for REP One fold is used as pruning set. (default 3)
-R Set if NOT uses randomization (default:use randomization)
-E Set whether consider the exclusive expressions for nominal attributes (default false)
-M <min. weights> Set the minimal weights of instances within a split. (default 2.0)
-P <number of antecedents> Set number of antecedents for pre-pruning if -1, then REP is used (default -1)
-S <seed> Set the seed of randomization (default 1)
| Constructor and Description |
|---|
ConjunctiveRule() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(weka.core.Instances instances)
Builds a single rule learner with REP dealing with nominal classes or
numeric classes.
|
double[] |
distributionForInstance(weka.core.Instance instance)
Computes class distribution for the given instance.
|
java.lang.String |
exclusiveTipText()
Returns the tip text for this property
|
java.lang.String |
foldsTipText()
Returns the tip text for this property
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getExclusive()
Returns whether exclusive expressions for nominal attributes splits are
considered
|
int |
getFolds()
returns the current number of folds
|
double |
getMinNo()
Gets the minimum total weight of the instances in a rule
|
int |
getNumAntds()
Gets the number of antecedants
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
long |
getSeed()
returns the current seed value for randomizing the data
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
boolean |
hasAntds()
Whether this rule has antecedents, i.e.
|
boolean |
isCover(weka.core.Instance datum)
Whether the instance covered by this rule
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options Valid options are:
|
static void |
main(java.lang.String[] args)
Main method.
|
java.lang.String |
minNoTipText()
Returns the tip text for this property
|
java.lang.String |
numAntdsTipText()
Returns the tip text for this property
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setExclusive(boolean e)
Sets whether exclusive expressions for nominal attributes splits are
considered
|
void |
setFolds(int folds)
the number of folds to use
|
void |
setMinNo(double m)
Sets the minimum total weight of the instances in a rule
|
void |
setNumAntds(int n)
Sets the number of antecedants
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSeed(long s)
sets the seed for randomizing the data
|
java.lang.String |
toString()
Prints this rule
|
java.lang.String |
toString(java.lang.String att,
java.lang.String cl)
Prints this rule with the specified class label
|
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlacespublic java.lang.String globalInfo()
public java.util.Enumeration<weka.core.Option> 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)
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.classifiers.AbstractClassifierpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-N <number of folds> Set number of folds for REP One fold is used as pruning set. (default 3)
-R Set if NOT uses randomization (default:use randomization)
-E Set whether consider the exclusive expressions for nominal attributes (default false)
-M <min. weights> Set the minimal weights of instances within a split. (default 2.0)
-P <number of antecedents> Set number of antecedents for pre-pruning if -1, then REP is used (default -1)
-S <seed> Set the seed of randomization (default 1)
setOptions in interface weka.core.OptionHandlersetOptions in class weka.classifiers.AbstractClassifieroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.classifiers.AbstractClassifierpublic java.lang.String foldsTipText()
public void setFolds(int folds)
folds - the number of folds to usepublic int getFolds()
public java.lang.String seedTipText()
public void setSeed(long s)
s - the seed valuepublic long getSeed()
public java.lang.String exclusiveTipText()
public boolean getExclusive()
public void setExclusive(boolean e)
e - whether to consider exclusive expressions for nominal attribute
splitspublic java.lang.String minNoTipText()
public void setMinNo(double m)
m - the minimum total weight of the instances in a rulepublic double getMinNo()
public java.lang.String numAntdsTipText()
public void setNumAntds(int n)
n - the number of antecedantspublic int getNumAntds()
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.classifiers.ClassifiergetCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.classifiers.AbstractClassifierpublic void buildClassifier(weka.core.Instances instances)
throws java.lang.Exception
buildClassifier in interface weka.classifiers.Classifierinstances - the training datajava.lang.Exception - if classifier can't be built successfullypublic double[] distributionForInstance(weka.core.Instance instance)
throws java.lang.Exception
distributionForInstance in interface weka.classifiers.ClassifierdistributionForInstance in class weka.classifiers.AbstractClassifierinstance - the instance for which distribution is to be computedjava.lang.Exception - if given instance is nullpublic boolean isCover(weka.core.Instance datum)
datum - the instance in questionpublic 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 rulecl - the string standing for value in the consequent of this rulepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.classifiers.AbstractClassifierpublic static void main(java.lang.String[] args)
args - the options for the classifier