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)
-
Apriori()
- Constructor that allows to sets default values for the
minimum confidence and the maximum number of rules
the minimum confidence.
-
buildAssociations(Instances)
- Method that generates all large itemsets with a minimum support, and from
these all association rules with a minimum confidence.
-
getDelta()
- Get the value of delta.
-
getLowerBoundMinSupport()
- Get the value of lowerBoundMinSupport.
-
getMinConfidence()
- Get the value of minConfidence.
-
getMinSupport()
- Get the value of minSupport.
-
getNumRules()
- Get the value of numRules.
-
getOptions()
- Gets the current settings of the Apriori object.
-
getSignificanceLevel()
- Get the value of significanceLevel.
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
resetOptions()
- Resets the options to the default values.
-
setDelta(double)
- Set the value of delta.
-
setLowerBoundMinSupport(double)
- Set the value of lowerBoundMinSupport.
-
setMinConfidence(double)
- Set the value of minConfidence.
-
setMinSupport(double)
- Set the value of minSupport.
-
setNumRules(int)
- Set the value of numRules.
-
setOptions(String[])
- Parses a given list of options.
-
setSignificanceLevel(double)
- Set the value of significanceLevel.
-
toString()
- Outputs the size of all the generated sets of itemsets and the rules.
Apriori
public Apriori()
- Constructor that allows to sets default values for the
minimum confidence and the maximum number of rules
the minimum confidence.
resetOptions
public void resetOptions()
- Resets the options to the default values.
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
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
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
getOptions
public String[] getOptions()
- Gets the current settings of the Apriori object.
- Returns:
- an array of strings suitable for passing to setOptions
toString
public String toString()
- Outputs the size of all the generated sets of itemsets and the rules.
- Overrides:
- toString in class Object
getMinSupport
public double getMinSupport()
- Get the value of minSupport.
- Returns:
- Value of minSupport.
setMinSupport
public void setMinSupport(double v)
- Set the value of minSupport.
- Parameters:
- v - Value to assign to minSupport.
getLowerBoundMinSupport
public double getLowerBoundMinSupport()
- Get the value of lowerBoundMinSupport.
- Returns:
- Value of lowerBoundMinSupport.
setLowerBoundMinSupport
public void setLowerBoundMinSupport(double v)
- Set the value of lowerBoundMinSupport.
- Parameters:
- v - Value to assign to lowerBoundMinSupport.
getMinConfidence
public double getMinConfidence()
- Get the value of minConfidence.
- Returns:
- Value of minConfidence.
setMinConfidence
public void setMinConfidence(double v)
- Set the value of minConfidence.
- Parameters:
- v - Value to assign to minConfidence.
getNumRules
public int getNumRules()
- Get the value of numRules.
- Returns:
- Value of numRules.
setNumRules
public void setNumRules(int v)
- Set the value of numRules.
- Parameters:
- v - Value to assign to numRules.
getDelta
public double getDelta()
- Get the value of delta.
- Returns:
- Value of delta.
setDelta
public void setDelta(double v)
- Set the value of delta.
- Parameters:
- v - Value to assign to delta.
getSignificanceLevel
public double getSignificanceLevel()
- Get the value of significanceLevel.
- Returns:
- Value of significanceLevel.
setSignificanceLevel
public void setSignificanceLevel(double v)
- Set the value of significanceLevel.
- Parameters:
- v - Value to assign to significanceLevel.
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