|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.rules.car.CarClassifier
weka.classifiers.rules.car.JCBA
public class JCBA
Class implemting a java version of the CBA algorithm using a CrTree. Alternatively the classifier can be used as a standard decision list classifier. The Tree Structure is described in: W. Li, J. Han, J.Pei: CMAR: Accurate and Efficient Classification Based on Multiple Class-Association Rules. In ICDM'01:369-376,2001. The CBA algorithm is described in: B. Liu, W. Hsu, Y. Ma: Integrating Classification and Association Rule Mining. In KDD'98:80-86,1998. Valid options are:
-A Class Association Rule Miner String
Class Association Rule Miner String should contain the full class name of a scheme
included for selection followed by options to the Class Association Rule Miner.
-C confidence value
Sets the confidence value for the optional pessimistic-error-rate-based pruning (default 0.25).
-E
If set the optional pessimistic-error-rate-based pruning is enabled.
-N
If set the optional and the obligatory pruning step are disabled. Classifier behaves like a standard decision list classifier.
-V
If set the mined rule set is printed out as well.
Constructor Summary | |
---|---|
JCBA()
|
Method Summary | |
---|---|
void |
buildClassifier(Instances newInstances)
Generates the classifier. |
java.lang.String |
carMinerTipText()
Gets the tipText for this option. |
java.lang.String |
CBATipText()
Gets the tipText for the specified option. |
java.lang.String |
CFTipText()
Gets the tipText for the specified option. |
double |
classifyInstance(Instance instance)
Classifies an instance |
double[] |
distributionForInstance(Instance newInstance)
Returns the class distribution for an instance |
java.util.Enumeration |
enumerateMeasures()
Lists all additional statistics that are available |
Capabilities |
getCapabilities()
Returns default capabilities of the base associator. |
CARuleMiner |
getCarMiner()
Gets the class association rule miner |
boolean |
getCBA()
Gets whether or not CBA or a standard decision list classifier is used |
float |
getCF()
Gets the confidence value for pessimistic-error-rate-based pruning |
double |
getMeasure(java.lang.String additionalMeasureName)
Gets the additional statistics |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
boolean |
getOptPruning()
Gets whether or not optional pruning is turned on |
JCBAPruning |
getPrune()
Gets the pruning algorithm: JCBAPruning |
java.lang.String |
getRevision()
Returns the revision string. |
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. |
boolean |
getTreeOutput()
Gets whether or not the mined rule set is part of the output |
java.lang.String |
globalInfo()
Gets a description of the JCBA algorithm |
double |
intermediateClassificationForInstance(Instance instance,
JCBAPruning tree,
Instances instances)
Does the intermediate classification step during the CBA's obligatory pruning |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
double |
measureMiningTime()
Gets the mining time |
double |
measureNumClassRules()
Gets the number of rules used for classification |
double |
measureNumMinedRules()
Gets the number of mined rules |
double |
measureNumPrunedRules()
Gets the number of rules after the optional pruning step |
double |
measurePruningTime()
Gets the pruning time in seconds |
java.lang.String |
optPruningTipText()
Gets the tipText for the specified option. |
void |
setCarMiner(CARuleMiner assoc)
Sets the class association rule miner |
void |
setCBA(boolean flag)
Sets whether or not CBA or a standard decision list classifier is used |
void |
setCF(float value)
Sets the confidence value for pessimistic-error-rate-based pruning |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setOptPruning(boolean flag)
Sets optional pruning |
void |
setTreeOutput(boolean flag)
Sets whether or not mined rule set is part of the output |
java.lang.String |
toString()
Prints the rules |
java.lang.String |
treeOutputTipText()
Gets the tipText for the specified option. |
Methods inherited from class weka.classifiers.rules.car.CarClassifier |
---|
sortAttributes |
Methods inherited from class weka.classifiers.AbstractClassifier |
---|
debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JCBA()
Method Detail |
---|
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-A Class Association Rule Miner String
Class Association Rule Miner String should contain the full class name of a scheme
included for selection followed by options to the Class Association Rule Miner.
-C confidence value
Sets the confidence value for the optional pessimistic-error-rate-based pruning (default 0.25).
-E
If set the optional pessimistic-error-rate-based pruning is enabled.
-N
If set the optional and the obligatory pruning step are disabled. Classifier behaves like a standard decision list classifier.
-V
If set the mined rule set is printed out as well.
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
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 AbstractClassifier
public java.lang.String carMinerTipText()
public void setCarMiner(CARuleMiner assoc)
assoc
- the class association rule minerpublic CARuleMiner getCarMiner()
public JCBAPruning getPrune()
public java.lang.String optPruningTipText()
public void setOptPruning(boolean flag)
flag
- boolean flagpublic boolean getOptPruning()
public java.lang.String CFTipText()
public void setCF(float value)
value
- the confidence valuepublic float getCF()
public java.lang.String treeOutputTipText()
public void setTreeOutput(boolean flag)
flag
- boolean flagpublic boolean getTreeOutput()
public java.lang.String CBATipText()
public void setCBA(boolean flag)
flag
- true if CBA is used, false otherwisepublic boolean getCBA()
public void buildClassifier(Instances newInstances) throws java.lang.Exception
buildClassifier
in interface Classifier
newInstances
- set of instances serving as training data
java.lang.Exception
- if the classifier has not been generated successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
instance
- the instance
java.lang.Exception
- exception if instance cannot be classifiedpublic double[] distributionForInstance(Instance newInstance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
newInstance
- the instance
java.lang.Exception
- exception if it cannot be calculatedpublic double intermediateClassificationForInstance(Instance instance, JCBAPruning tree, Instances instances) throws java.lang.Exception
instance
- the instance to classifiytree
- the actual CrTree with the actual rule setinstances
- the instances
java.lang.Exception
- exception if instance cannot be classifiedpublic java.lang.String toString()
toString
in class java.lang.Object
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 additional measure
public double measureMiningTime()
public double measurePruningTime()
public double measureNumMinedRules()
public double measureNumPrunedRules()
public double measureNumClassRules()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |