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).

-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). -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).

Version:
$Revision: 1.4 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

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 getDelta()
Get the value of delta.
 o getLowerBoundMinSupport()
Get the value of lowerBoundMinSupport.
 o getMinConfidence()
Get the value of minConfidence.
 o getMinSupport()
Get the value of minSupport.
 o getNumRules()
Get the value of numRules.
 o getOptions()
Gets the current settings of the Apriori object.
 o getSignificanceLevel()
Get the value of significanceLevel.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 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 setMinConfidence(double)
Set the value of minConfidence.
 o setMinSupport(double)
Set the value of minSupport.
 o setNumRules(int)
Set the value of numRules.
 o setOptions(String[])
Parses a given list of options.
 o setSignificanceLevel(double)
Set the value of significanceLevel.
 o toString()
Outputs the size of all the generated sets of itemsets and the rules.

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 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).

-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). -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).

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 getMinSupport
 public double getMinSupport()
Get the value of minSupport.

Returns:
Value of minSupport.
 o setMinSupport
 public void setMinSupport(double v)
Set the value of minSupport.

Parameters:
v - Value to assign to minSupport.
 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 getMinConfidence
 public double getMinConfidence()
Get the value of minConfidence.

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

Parameters:
v - Value to assign to minConfidence.
 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 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 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