|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.associations.Associator | +--weka.associations.Apriori
Class implementing an Apriori-type algorithm. Iteratively reduces the minimum support until it finds the required number of rules with the given minimum confidence.
Reference: R. Agrawal, R. Srikant (1994). Fast algorithms for mining association rules in large databases . Proc International Conference on Very Large Databases, pp. 478-499. Santiage, Chile: Morgan Kaufmann, Los Altos, CA.
Valid options are:
-N required number of rules
The required number of rules (default: 10).
-T type of metric by which to sort rules
0 = confidence | 1 = lift | 2 = leverage | 3 = Conviction.
-C minimum confidence 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).
-S significance level
If used, rules are tested for significance at
the given level. Slower (default = no significance testing).
-R
If set then columns that contain all missing values are removed from
the data.
-I
If set the itemsets found are also output (default = no).
Field Summary | |
static Tag[] |
TAGS_SELECTION
|
Constructor Summary | |
Apriori()
Constructor that allows to sets default values for the minimum confidence and the maximum number of rules the minimum confidence. |
Method Summary | |
void |
buildAssociations(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 |
deltaTipText()
Returns the tip text for this property |
double |
getDelta()
Get the value of delta. |
double |
getLowerBoundMinSupport()
Get the value of lowerBoundMinSupport. |
SelectedTag |
getMetricType()
Get the metric type |
double |
getMinMetric()
Get the value of minConfidence. |
int |
getNumRules()
Get the value of numRules. |
java.lang.String[] |
getOptions()
Gets the current settings of the Apriori object. |
boolean |
getRemoveAllMissingCols()
Returns whether columns containing all missing values are to be removed |
double |
getSignificanceLevel()
Get the value of significanceLevel. |
double |
getUpperBoundMinSupport()
Get the value of upperBoundMinSupport. |
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()
Returns the tip text for this property |
static void |
main(java.lang.String[] options)
Main method for testing this class. |
java.lang.String |
metricTypeTipText()
Returns the tip text for this property |
java.lang.String |
minMetricTipText()
Returns the tip text for this property |
java.lang.String |
numRulesTipText()
Returns the tip text for this property |
java.lang.String |
removeAllMissingColsTipText()
Returns the tip text for this property |
void |
resetOptions()
Resets the options to the default values. |
void |
setDelta(double v)
Set the value of delta. |
void |
setLowerBoundMinSupport(double v)
Set the value of lowerBoundMinSupport. |
void |
setMetricType(SelectedTag d)
Set the metric type for ranking rules |
void |
setMinMetric(double v)
Set the value of minConfidence. |
void |
setNumRules(int v)
Set the value of numRules. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setRemoveAllMissingCols(boolean r)
Remove columns containing all missing values. |
void |
setSignificanceLevel(double v)
Set the value of significanceLevel. |
void |
setUpperBoundMinSupport(double v)
Set the value of upperBoundMinSupport. |
java.lang.String |
significanceLevelTipText()
Returns the tip text for this property |
java.lang.String |
toString()
Outputs the size of all the generated sets of itemsets and the rules. |
java.lang.String |
upperBoundMinSupportTipText()
Returns the tip text for this property |
Methods inherited from class weka.associations.Associator |
forName, makeCopies |
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 Apriori()
Method Detail |
public java.lang.String globalInfo()
public void resetOptions()
public void buildAssociations(Instances instances) throws java.lang.Exception
buildAssociations
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 OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-N required number of rules
The required number of rules (default: 10).
-T type of metric by which to sort rules
0 = confidence | 1 = lift | 2 = leverage | 3 = Conviction.
-C minimum metric 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).
-S significance level
If used, rules are tested for significance at
the given level. Slower (default = no significance testing).
-I
If set the itemsets found are also output (default = no).
-V
If set then progress is reported iteratively during execution.
-R
If set then columns that contain all missing values are removed from
the data.
setOptions
in interface 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 OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String removeAllMissingColsTipText()
public void setRemoveAllMissingCols(boolean r)
r
- true if cols are to be removed.public boolean getRemoveAllMissingCols()
public java.lang.String upperBoundMinSupportTipText()
public double getUpperBoundMinSupport()
public void setUpperBoundMinSupport(double v)
v
- Value to assign to upperBoundMinSupport.public java.lang.String lowerBoundMinSupportTipText()
public double getLowerBoundMinSupport()
public void setLowerBoundMinSupport(double v)
v
- Value to assign to lowerBoundMinSupport.public SelectedTag getMetricType()
public java.lang.String metricTypeTipText()
public void setMetricType(SelectedTag d)
d
- the type of metricpublic java.lang.String minMetricTipText()
public double getMinMetric()
public void setMinMetric(double v)
v
- Value to assign to minConfidence.public java.lang.String numRulesTipText()
public int getNumRules()
public void setNumRules(int v)
v
- Value to assign to numRules.public java.lang.String deltaTipText()
public double getDelta()
public void setDelta(double v)
v
- Value to assign to delta.public java.lang.String significanceLevelTipText()
public double getSignificanceLevel()
public void setSignificanceLevel(double v)
v
- Value to assign to significanceLevel.public static void main(java.lang.String[] options)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London