public class WeightedClassifier extends CarClassifier implements weka.core.OptionHandler, weka.core.AdditionalMeasureProducer, weka.core.CapabilitiesHandler
-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.
-W weighting scheme
Sets the weighting scheme: inverse|linear|equal (default).
-L rule limit
Set a rule limit for the number of rules used for classification after the
pruning step. Uses the first N rules only.
| Modifier and Type | Field and Description |
|---|---|
static weka.core.Tag[] |
TAGS_SELECTION |
| Constructor and Description |
|---|
WeightedClassifier() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(weka.core.Instances newInstances)
Generates the classifier.
|
java.lang.String |
carMinerTipText()
Gets the tipText for this option.
|
double[] |
distributionForInstance(weka.core.Instance newInstance)
Returns the class distribution for an instance
|
java.util.Enumeration |
enumerateMeasures()
Lists all additional statistics that are available
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the base associator.
|
weka.associations.CARuleMiner |
getCarMiner()
Gets the class association rule miner
|
double |
getMeasure(java.lang.String additionalMeasureName)
Gets the additional statistics
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
PruneCAR |
getPrune()
Gets the pruning algorithm: PrecedencePruning
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getRuleLimit()
Gets the rule limit (-1 means no limit)
|
weka.core.SelectedTag |
getWeightScheme()
Gets the type of the weighting scheme
|
java.lang.String |
globalInfo()
Gets a description of WeightedClassifier
|
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 |
measureAverageRankCorrect()
Gets the average rank of the first rule that covers an instance.
|
double |
measureAverageRankFires()
Gets the average rank of the first rule that covers an instance and
predicts it correctly.
|
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 |
ruleLimitTipText()
Gets the tipText for this option.
|
void |
setCarMiner(weka.associations.CARuleMiner assoc)
Sets the class association rule miner
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setRuleLimit(int n)
Sets a rule limit.
|
void |
setWeightScheme(weka.core.SelectedTag type)
Sets the weighting scheme
|
java.lang.String |
toString()
Prints the rules
|
double |
weight(java.lang.String type,
double rank)
Weights a rule
|
java.lang.String |
weightSchemeTipText()
Gets the tipText for this option.
|
sortAttributesbatchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlacespublic weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.classifiers.ClassifiergetCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.classifiers.AbstractClassifierpublic java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.classifiers.AbstractClassifierpublic 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.
-W weighting scheme
Sets the weighting scheme: inverse|linear|equal (default).
-L rule limit
Set a rule limit for the number of rules used for classification after the
pruning step. Uses the first N rules only.
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 carMinerTipText()
public void setCarMiner(weka.associations.CARuleMiner assoc)
assoc - the class association rule minerpublic weka.associations.CARuleMiner getCarMiner()
public PruneCAR getPrune()
public void buildClassifier(weka.core.Instances newInstances)
throws java.lang.Exception
buildClassifier in interface weka.classifiers.ClassifiernewInstances - set of instances serving as training datajava.lang.Exception - if the classifier has not been generated successfullypublic double[] distributionForInstance(weka.core.Instance newInstance)
throws java.lang.Exception
distributionForInstance in interface weka.classifiers.ClassifierdistributionForInstance in class weka.classifiers.AbstractClassifiernewInstance - the instancejava.lang.Exception - exception if it cannot be calculatedpublic java.lang.String weightSchemeTipText()
public void setWeightScheme(weka.core.SelectedTag type)
type - the type of the weighting scheme: inverse | linear | equalpublic weka.core.SelectedTag getWeightScheme()
public java.lang.String ruleLimitTipText()
public void setRuleLimit(int n)
n - the rule limitpublic int getRuleLimit()
public double weight(java.lang.String type,
double rank)
type - the weighting schemerank - the rank of the rule in the sort orderpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Enumeration enumerateMeasures()
enumerateMeasures in interface weka.core.AdditionalMeasureProducerpublic double getMeasure(java.lang.String additionalMeasureName)
getMeasure in interface weka.core.AdditionalMeasureProduceradditionalMeasureName - the name of the additional measurepublic double measureMiningTime()
public double measurePruningTime()
public double measureNumMinedRules()
public double measureNumPrunedRules()
public double measureNumClassRules()
public double measureAverageRankFires()
public double measureAverageRankCorrect()
public java.lang.String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.classifiers.AbstractClassifierpublic static void main(java.lang.String[] argv)
argv - the options