All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.associations.Apriori

java.lang.Object
   |
   +----weka.associations.Associator
           |
           +----weka.associations.Apriori

public class Apriori
extends Associator
implements OptionHandler
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).

Author:
Eibe Frank (eibe@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz)

Variable Index

 o TAGS_SELECTION

Constructor Index

 o Apriori()
Constructor that allows to sets default values for the minimum confidence and the maximum number of rules the minimum confidence.

Method Index

 o buildAssociations(Instances)
Method that generates all large itemsets with a minimum support, and from these all association rules with a minimum confidence.
 o deltaTipText()
Returns the tip text for this property
 o getDelta()
Get the value of delta.
 o getLowerBoundMinSupport()
Get the value of lowerBoundMinSupport.
 o getMetricType()
Get the metric type
 o getMinMetric()
Get the value of minConfidence.
 o getNumRules()
Get the value of numRules.
 o getOptions()
Gets the current settings of the Apriori object.
 o getRemoveAllMissingCols()
Returns whether columns containing all missing values are to be removed
 o getSignificanceLevel()
Get the value of significanceLevel.
 o getUpperBoundMinSupport()
Get the value of upperBoundMinSupport.
 o globalInfo()
Returns a string describing this associator
 o listOptions()
Returns an enumeration describing the available options
 o lowerBoundMinSupportTipText()
Returns the tip text for this property
 o main(String[])
Main method for testing this class.
 o metricTypeTipText()
Returns the tip text for this property
 o minMetricTipText()
Returns the tip text for this property
 o numRulesTipText()
Returns the tip text for this property
 o removeAllMissingColsTipText()
Returns the tip text for this property
 o resetOptions()
Resets the options to the default values.
 o setDelta(double)
Set the value of delta.
 o setLowerBoundMinSupport(double)
Set the value of lowerBoundMinSupport.
 o setMetricType(SelectedTag)
Set the metric type for ranking rules
 o setMinMetric(double)
Set the value of minConfidence.
 o setNumRules(int)
Set the value of numRules.
 o setOptions(String[])
Parses a given list of options.
 o setRemoveAllMissingCols(boolean)
Remove columns containing all missing values.
 o setSignificanceLevel(double)
Set the value of significanceLevel.
 o setUpperBoundMinSupport(double)
Set the value of upperBoundMinSupport.
 o significanceLevelTipText()
Returns the tip text for this property
 o toString()
Outputs the size of all the generated sets of itemsets and the rules.
 o upperBoundMinSupportTipText()
Returns the tip text for this property

Variables

 o TAGS_SELECTION
 public static final Tag TAGS_SELECTION[]

Constructors

 o Apriori
 public Apriori()
Constructor that allows to sets default values for the minimum confidence and the maximum number of rules the minimum confidence.

Methods

 o globalInfo
 public String globalInfo()
Returns a string describing this associator

Returns:
a description of the evaluator suitable for displaying in the explorer/experimenter gui
 o resetOptions
 public void resetOptions()
Resets the options to the default values.

 o buildAssociations
 public void buildAssociations(Instances instances) throws Exception
Method that generates all large itemsets with a minimum support, and from these all association rules with a minimum confidence.

Parameters:
instances - the instances to be used for generating the associations
Throws: Exception
if rules can't be built successfully
Overrides:
buildAssociations in class Associator
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o setOptions
 public void setOptions(String options[]) throws Exception
Parses a given list of options. 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 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.

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o getOptions
 public String[] getOptions()
Gets the current settings of the Apriori object.

Returns:
an array of strings suitable for passing to setOptions
 o toString
 public String toString()
Outputs the size of all the generated sets of itemsets and the rules.

Overrides:
toString in class Object
 o removeAllMissingColsTipText
 public String removeAllMissingColsTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setRemoveAllMissingCols
 public void setRemoveAllMissingCols(boolean r)
Remove columns containing all missing values.

Parameters:
r - true if cols are to be removed.
 o getRemoveAllMissingCols
 public boolean getRemoveAllMissingCols()
Returns whether columns containing all missing values are to be removed

Returns:
true if columns are to be removed.
 o upperBoundMinSupportTipText
 public String upperBoundMinSupportTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getUpperBoundMinSupport
 public double getUpperBoundMinSupport()
Get the value of upperBoundMinSupport.

Returns:
Value of upperBoundMinSupport.
 o setUpperBoundMinSupport
 public void setUpperBoundMinSupport(double v)
Set the value of upperBoundMinSupport.

Parameters:
v - Value to assign to upperBoundMinSupport.
 o lowerBoundMinSupportTipText
 public String lowerBoundMinSupportTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getLowerBoundMinSupport
 public double getLowerBoundMinSupport()
Get the value of lowerBoundMinSupport.

Returns:
Value of lowerBoundMinSupport.
 o setLowerBoundMinSupport
 public void setLowerBoundMinSupport(double v)
Set the value of lowerBoundMinSupport.

Parameters:
v - Value to assign to lowerBoundMinSupport.
 o getMetricType
 public SelectedTag getMetricType()
Get the metric type

Returns:
the type of metric to use for ranking rules
 o metricTypeTipText
 public String metricTypeTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setMetricType
 public void setMetricType(SelectedTag d)
Set the metric type for ranking rules

Parameters:
d - the type of metric
 o minMetricTipText
 public String minMetricTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getMinMetric
 public double getMinMetric()
Get the value of minConfidence.

Returns:
Value of minConfidence.
 o setMinMetric
 public void setMinMetric(double v)
Set the value of minConfidence.

Parameters:
v - Value to assign to minConfidence.
 o numRulesTipText
 public String numRulesTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getNumRules
 public int getNumRules()
Get the value of numRules.

Returns:
Value of numRules.
 o setNumRules
 public void setNumRules(int v)
Set the value of numRules.

Parameters:
v - Value to assign to numRules.
 o deltaTipText
 public String deltaTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getDelta
 public double getDelta()
Get the value of delta.

Returns:
Value of delta.
 o setDelta
 public void setDelta(double v)
Set the value of delta.

Parameters:
v - Value to assign to delta.
 o significanceLevelTipText
 public String significanceLevelTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getSignificanceLevel
 public double getSignificanceLevel()
Get the value of significanceLevel.

Returns:
Value of significanceLevel.
 o setSignificanceLevel
 public void setSignificanceLevel(double v)
Set the value of significanceLevel.

Parameters:
v - Value to assign to significanceLevel.
 o main
 public static void main(String options[])
Main method for testing this class.


All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home