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)
-
TAGS_SELECTION
-
-
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.
-
deltaTipText()
- Returns the tip text for this property
-
getDelta()
- Get the value of delta.
-
getLowerBoundMinSupport()
- Get the value of lowerBoundMinSupport.
-
getMetricType()
- Get the metric type
-
getMinMetric()
- Get the value of minConfidence.
-
getNumRules()
- Get the value of numRules.
-
getOptions()
- Gets the current settings of the Apriori object.
-
getRemoveAllMissingCols()
- Returns whether columns containing all missing values are to be removed
-
getSignificanceLevel()
- Get the value of significanceLevel.
-
getUpperBoundMinSupport()
- Get the value of upperBoundMinSupport.
-
globalInfo()
- Returns a string describing this associator
-
listOptions()
- Returns an enumeration describing the available options
-
lowerBoundMinSupportTipText()
- Returns the tip text for this property
-
main(String[])
- Main method for testing this class.
-
metricTypeTipText()
- Returns the tip text for this property
-
minMetricTipText()
- Returns the tip text for this property
-
numRulesTipText()
- Returns the tip text for this property
-
removeAllMissingColsTipText()
- Returns the tip text for this property
-
resetOptions()
- Resets the options to the default values.
-
setDelta(double)
- Set the value of delta.
-
setLowerBoundMinSupport(double)
- Set the value of lowerBoundMinSupport.
-
setMetricType(SelectedTag)
- Set the metric type for ranking rules
-
setMinMetric(double)
- Set the value of minConfidence.
-
setNumRules(int)
- Set the value of numRules.
-
setOptions(String[])
- Parses a given list of options.
-
setRemoveAllMissingCols(boolean)
- Remove columns containing all missing values.
-
setSignificanceLevel(double)
- Set the value of significanceLevel.
-
setUpperBoundMinSupport(double)
- Set the value of upperBoundMinSupport.
-
significanceLevelTipText()
- Returns the tip text for this property
-
toString()
- Outputs the size of all the generated sets of itemsets and the rules.
-
upperBoundMinSupportTipText()
- Returns the tip text for this property
TAGS_SELECTION
public static final Tag TAGS_SELECTION[]
Apriori
public Apriori()
- Constructor that allows to sets default values for the
minimum confidence and the maximum number of rules
the minimum confidence.
globalInfo
public String globalInfo()
- Returns a string describing this associator
- Returns:
- a description of the evaluator suitable for
displaying in the explorer/experimenter gui
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).
-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
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
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
setRemoveAllMissingCols
public void setRemoveAllMissingCols(boolean r)
- Remove columns containing all missing values.
- Parameters:
- r - true if cols are to be removed.
getRemoveAllMissingCols
public boolean getRemoveAllMissingCols()
- Returns whether columns containing all missing values are to be removed
- Returns:
- true if columns are to be removed.
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
getUpperBoundMinSupport
public double getUpperBoundMinSupport()
- Get the value of upperBoundMinSupport.
- Returns:
- Value of upperBoundMinSupport.
setUpperBoundMinSupport
public void setUpperBoundMinSupport(double v)
- Set the value of upperBoundMinSupport.
- Parameters:
- v - Value to assign to upperBoundMinSupport.
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
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.
getMetricType
public SelectedTag getMetricType()
- Get the metric type
- Returns:
- the type of metric to use for ranking rules
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
setMetricType
public void setMetricType(SelectedTag d)
- Set the metric type for ranking rules
- Parameters:
- d - the type of metric
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
getMinMetric
public double getMinMetric()
- Get the value of minConfidence.
- Returns:
- Value of minConfidence.
setMinMetric
public void setMinMetric(double v)
- Set the value of minConfidence.
- Parameters:
- v - Value to assign to minConfidence.
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
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.
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
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.
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
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