|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.Associator
wpi.associations.Associator
wpi.associations.AprioriSets
Class implementing an Apriori-type algorithm that may understand sets. Sets must be loaded as strings into WEKA and are then parsed using ^ or & to delimit items. Items are split into individual Attribute-Value pairs for the item based ARMiner algorithm. WEKA iteratively reduces the minimum support until it finds the required number of rules with the given minimum confidence.
This class implements the Apriori algorithm for finding large itemsets. (see "Fast Algorithms for Mining Association Rules" by Rakesh Agrawal and Ramakrishnan Srikant from IBM Almaden Research Center 1994) Valid options are:
-N required number of rules
The required number of rules (default: 10).
-C minimum confidence score of a rule
The minimum confidence of a rule (default: 0.9).
-D delta for minimum support
The delta by which the minimum support is decreased in
each iteration (default: 0.05).
-U upper bound for minimum support
The upper bound for minimum support. Don't explicitly look for
rules with more than this level of support.
-M lower bound for minimum support
The lower bound for the minimum support (default = 0.1).
-V
If set then progress is reported iteratively during execution.
-A
The range of required attributes for the antecedents.
-B
The maximum number of antecedent items.
-Y
The range of required attributes for the consequents.
-Z
The minimum number of consequent items.
Field Summary | |
protected weka.core.FastVector[] |
m_allTheRules
The list of all generated rules. |
protected java.util.Hashtable |
m_attributeHash
A hash listing attribute value pair Strings by Integer key |
protected int |
m_cycles
Number of cycles used before required number of rules was one. |
protected double |
m_delta
Delta by which m_minSupport is decreased in each iteration. |
protected weka.core.FastVector |
m_hashtables
The same information stored in hash tables. |
protected weka.core.Instances |
m_instances
The instances (transactions) to be used for generating the association rules. |
protected double |
m_lowerBoundMinSupport
The lower bound for the minimum support. |
protected weka.core.FastVector |
m_Ls
The set of all sets of itemsets L. |
protected int |
m_maxAntecedents
The maximum number of antecedents in a rule |
protected int |
m_maxRulesOutput
The maximum number of rules that are output. |
protected double |
m_minConfidence
The minimum confidence score. |
protected int |
m_minConsequents
The minimum number of consequents in a rule |
protected double |
m_minSupport
The minimum support. |
protected boolean |
m_outputItemSets
Output itemsets found? |
protected weka.core.Range |
m_requiredAntecedentAttributes
The attributes required to be in the antecedents of the rules |
protected weka.core.Range |
m_requiredConsequentAttributes
The attributes required to be in the consequents of the rules |
protected java.util.Vector |
m_rulesFound
The vector containing all found AssociationRules |
protected double |
m_upperBoundMinSupport
The upper bound on the support |
protected boolean |
m_verbose
Verbose mode? |
Fields inherited from class wpi.associations.Associator |
logger, logStatsFileName |
Constructor Summary | |
AprioriSets()
Constructor that allows to sets default values for the minimum confidence and the maximum number of rules the minimum confidence. |
Method Summary | |
java.lang.String |
deltaTipText()
|
double |
getDelta()
|
double |
getLowerBoundMinSupport()
|
int |
getMaxAntecedents()
|
int |
getMinConsequents()
|
double |
getMinMetric()
|
int |
getNumRules()
|
java.lang.String[] |
getOptions()
Gets the current settings of the Apriori object. |
java.lang.String |
getRequiredAntecedents()
|
java.lang.String |
getRequiredConsequents()
|
double |
getUpperBoundMinSupport()
|
java.lang.String |
globalInfo()
Returns a string describing this associator |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
java.lang.String |
lowerBoundMinSupportTipText()
|
static void |
main(java.lang.String[] options)
Main method for testing this class. |
java.lang.String |
maxAntecedentsTipText()
|
java.lang.String |
minConsequentsTipText()
|
void |
mineAssociations(weka.core.Instances instances)
Method that generates all large itemsets with a minimum support, and from these all association rules with a minimum confidence. |
java.lang.String |
minMetricTipText()
|
java.lang.String |
numRulesTipText()
|
java.lang.String |
requiredAntecedentsTipText()
|
java.lang.String |
requiredConsequentsTipText()
|
void |
resetOptions()
Resets the options to the default values. |
void |
setDelta(double v)
|
void |
setLowerBoundMinSupport(double v)
|
void |
setMaxAntecedents(int i)
|
void |
setMinConsequents(int i)
|
void |
setMinMetric(double v)
|
void |
setNumRules(int v)
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setRequiredAntecedents(java.lang.String s)
|
void |
setRequiredConsequents(java.lang.String s)
|
void |
setUpperBoundMinSupport(double v)
|
java.lang.String |
toString()
Outputs the association rules and their confidences and supports. |
java.lang.String |
upperBoundMinSupportTipText()
|
Methods inherited from class wpi.associations.Associator |
buildAssociations |
Methods inherited from class weka.associations.Associator |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double m_minSupport
protected double m_upperBoundMinSupport
protected double m_lowerBoundMinSupport
protected double m_minConfidence
protected int m_maxRulesOutput
protected boolean m_verbose
protected double m_delta
protected int m_cycles
protected weka.core.FastVector m_Ls
protected weka.core.FastVector m_hashtables
protected weka.core.FastVector[] m_allTheRules
protected weka.core.Instances m_instances
protected boolean m_outputItemSets
protected int m_maxAntecedents
protected int m_minConsequents
protected java.util.Vector m_rulesFound
protected weka.core.Range m_requiredAntecedentAttributes
protected weka.core.Range m_requiredConsequentAttributes
protected java.util.Hashtable m_attributeHash
Constructor Detail |
public AprioriSets()
Method Detail |
public java.lang.String globalInfo()
public void resetOptions()
public void mineAssociations(weka.core.Instances instances) throws java.lang.Exception
mineAssociations
in class Associator
instances
- the instances to be used for generating the associations
java.lang.Exception
- if rules can't be built successfullypublic java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-N required number of rules
The required number of rules (default: 10).
-C minimum confidence score of a rule
The minimum confidence of a rule (default: 0.9).
-D delta for minimum support
The delta by which the minimum support is decreased in
each iteration (default: 0.05).
-U upper bound for minimum support
The upper bound for minimum support. Don't explicitly look for
rules with more than this level of support.
-M lower bound for minimum support
The lower bound for the minimum support (default = 0.1).
-V
If set then progress is reported iteratively during execution.
-A
The range of required attributes for the antecedents.
-B
The maximum number of antecedent items.
-Y
The range of required attributes for the consequents.
-Z
The minimum number of consequent items.
setOptions
in interface weka.core.OptionHandler
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 weka.core.OptionHandler
public java.lang.String toString()
public java.lang.String requiredAntecedentsTipText()
public void setRequiredAntecedents(java.lang.String s)
public java.lang.String getRequiredAntecedents()
public java.lang.String requiredConsequentsTipText()
public void setRequiredConsequents(java.lang.String s)
public java.lang.String getRequiredConsequents()
public java.lang.String maxAntecedentsTipText()
public void setMaxAntecedents(int i)
public int getMaxAntecedents()
public java.lang.String minConsequentsTipText()
public void setMinConsequents(int i)
public int getMinConsequents()
public java.lang.String upperBoundMinSupportTipText()
public double getUpperBoundMinSupport()
public void setUpperBoundMinSupport(double v)
public java.lang.String lowerBoundMinSupportTipText()
public double getLowerBoundMinSupport()
public void setLowerBoundMinSupport(double v)
public java.lang.String minMetricTipText()
public double getMinMetric()
public void setMinMetric(double v)
public java.lang.String numRulesTipText()
public int getNumRules()
public void setNumRules(int v)
public java.lang.String deltaTipText()
public double getDelta()
public void setDelta(double v)
public static void main(java.lang.String[] options)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |