|
|||||||||
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.WeightedClassifier
public class WeightedClassifier
Class implemting three different weighted classifiers for class association rules. a) all rules are weighted equally with weight one (default behaviour). b) all rules are weighted linearly c) all rules are weighted using the inverse function 1/position in sort order of mining algorithm The pruning step is omitted. All mined rules are used for classifcation, if not specified otherwise with the -L option. 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.
-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.
Field Summary | |
---|---|
static Tag[] |
TAGS_SELECTION
|
Constructor Summary | |
---|---|
WeightedClassifier()
|
Method Summary | |
---|---|
void |
buildClassifier(Instances newInstances)
Generates the classifier. |
java.lang.String |
carMinerTipText()
Gets the tipText for this option. |
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 |
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) |
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(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(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. |
Methods inherited from class weka.classifiers.rules.car.CarClassifier |
---|
sortAttributes |
Methods inherited from class weka.classifiers.AbstractClassifier |
---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Tag[] TAGS_SELECTION
Constructor Detail |
---|
public WeightedClassifier()
Method Detail |
---|
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
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.
-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 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 PruneCAR getPrune()
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[] 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 java.lang.String weightSchemeTipText()
public void setWeightScheme(SelectedTag type)
type
- the type of the weighting scheme: inverse | linear | equalpublic 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 order
public 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 double measureAverageRankFires()
public double measureAverageRankCorrect()
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 |