类 Apriori
java.lang.Object
weka.associations.AbstractAssociator
weka.associations.Apriori
- 所有已实现的接口:
Serializable
,Cloneable
,Associator
,CARuleMiner
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
public class Apriori
extends AbstractAssociator
implements OptionHandler, CARuleMiner, TechnicalInformationHandler
Class implementing an Apriori-type algorithm.
Iteratively reduces the minimum support until it finds the required number of
rules with the given minimum confidence.
The algorithm has an option to mine class association rules. It is adapted as explained in the second reference.
For more information see:
R. Agrawal, R. Srikant: Fast Algorithms for Mining Association Rules in Large Databases. In: 20th International Conference on Very Large Data Bases, 478-499, 1994.
Bing Liu, Wynne Hsu, Yiming Ma: Integrating Classification and Association Rule Mining. In: Fourth International Conference on Knowledge Discovery and Data Mining, 80-86, 1998. BibTeX:
The algorithm has an option to mine class association rules. It is adapted as explained in the second reference.
For more information see:
R. Agrawal, R. Srikant: Fast Algorithms for Mining Association Rules in Large Databases. In: 20th International Conference on Very Large Data Bases, 478-499, 1994.
Bing Liu, Wynne Hsu, Yiming Ma: Integrating Classification and Association Rule Mining. In: Fourth International Conference on Knowledge Discovery and Data Mining, 80-86, 1998. BibTeX:
@inproceedings{Agrawal1994, author = {R. Agrawal and R. Srikant}, booktitle = {20th International Conference on Very Large Data Bases}, pages = {478-499}, publisher = {Morgan Kaufmann, Los Altos, CA}, title = {Fast Algorithms for Mining Association Rules in Large Databases}, year = {1994} } @inproceedings{Liu1998, author = {Bing Liu and Wynne Hsu and Yiming Ma}, booktitle = {Fourth International Conference on Knowledge Discovery and Data Mining}, pages = {80-86}, publisher = {AAAI Press}, title = {Integrating Classification and Association Rule Mining}, year = {1998} }Valid options are:
-N <required number of rules output> The required number of rules. (default = 10)
-T <0=confidence | 1=lift | 2=leverage | 3=Conviction> The metric type by which to rank rules. (default = confidence)
-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> Upper bound for minimum support. (default = 1.0)
-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)
-R Remove columns that contain all missing values (default = no)
-V Report progress iteratively. (default = no)
-A If set class association rules are mined. (default = no)
-c <the class index> The class index. (default = last)
- 版本:
- $Revision: 9096 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz), Stefan Mutter (mutter@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. -
方法概要
修饰符和类型方法说明void
buildAssociations
(Instances instances) Method that generates all large itemsets with a minimum support, and from these all association rules with a minimum confidence.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyreturns all the rulesReturns default capabilities of the classifier.boolean
getCar()
Gets whether class association ruels are minedint
Gets the class indexdouble
getDelta()
Get the value of delta.Gets the instances without the class atrribute.Gets only the class attribute of the instances.double
Get the value of lowerBoundMinSupport.Get the metric typedouble
Get the value of minConfidence.int
Get the value of numRules.String[]
Gets the current settings of the Apriori object.boolean
Gets whether itemsets are output as wellboolean
Returns whether columns containing all missing values are to be removedReturns the revision string.double
Get the value of significanceLevel.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.double
Get the value of upperBoundMinSupport.boolean
Gets whether algorithm is run in verbose modeReturns a string describing this associatorReturns an enumeration describing the available options.Returns the tip text for this propertystatic void
Main method.Returns the metric string for the chosen metric typeReturns the tip text for this propertyMethod that mines all class association rules with minimum support and with a minimum confidence.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyvoid
Resets the options to the default values.void
setCar
(boolean flag) Sets class association rule miningvoid
setClassIndex
(int index) Sets the class indexvoid
setDelta
(double v) Set the value of delta.void
setLowerBoundMinSupport
(double v) Set the value of lowerBoundMinSupport.void
Set the metric type for ranking rulesvoid
setMinMetric
(double v) Set the value of minConfidence.void
setNumRules
(int v) Set the value of numRules.void
setOptions
(String[] options) Parses a given list of options.void
setOutputItemSets
(boolean flag) Sets whether itemsets are output as wellvoid
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.void
setVerbose
(boolean flag) Sets verbose modeReturns the tip text for this propertytoString()
Outputs the size of all the generated sets of itemsets and the rules.Returns the tip text for this propertyReturns the tip text for this property从类继承的方法 weka.associations.AbstractAssociator
forName, makeCopies, makeCopy
-
字段详细资料
-
TAGS_SELECTION
Metric types.
-
-
构造器详细资料
-
Apriori
public Apriori()Constructor that allows to sets default values for the minimum confidence and the maximum number of rules the minimum confidence.
-
-
方法详细资料
-
globalInfo
Returns a string describing this associator- 返回:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- 指定者:
getTechnicalInformation
在接口中TechnicalInformationHandler
- 返回:
- the technical information about this class
-
resetOptions
public void resetOptions()Resets the options to the default values. -
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中Associator
- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中AbstractAssociator
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildAssociations
Method that generates all large itemsets with a minimum support, and from these all association rules with a minimum confidence.- 指定者:
buildAssociations
在接口中Associator
- 参数:
instances
- the instances to be used for generating the associations- 抛出:
Exception
- if rules can't be built successfully
-
mineCARs
Method that mines all class association rules with minimum support and with a minimum confidence.- 指定者:
mineCARs
在接口中CARuleMiner
- 参数:
data
- the instances for which class association rules should be mined- 返回:
- an sorted array of FastVector (confidence depended) containing the rules and metric information
- 抛出:
Exception
- if rules can't be built successfully
-
getInstancesNoClass
Gets the instances without the class atrribute.- 指定者:
getInstancesNoClass
在接口中CARuleMiner
- 返回:
- the instances without the class attribute.
-
getInstancesOnlyClass
Gets only the class attribute of the instances.- 指定者:
getInstancesOnlyClass
在接口中CARuleMiner
- 返回:
- the class attribute of all instances.
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-N <required number of rules output> The required number of rules. (default = 10)
-T <0=confidence | 1=lift | 2=leverage | 3=Conviction> The metric type by which to rank rules. (default = confidence)
-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> Upper bound for minimum support. (default = 1.0)
-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)
-R Remove columns that contain all missing values (default = no)
-V Report progress iteratively. (default = no)
-A If set class association rules are mined. (default = no)
-c <the class index> The class index. (default = last)
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Apriori object.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
-
toString
Outputs the size of all the generated sets of itemsets and the rules. -
metricString
Returns the metric string for the chosen metric type- 指定者:
metricString
在接口中CARuleMiner
- 返回:
- a string describing the used metric for the interestingness of a class association rule
-
removeAllMissingColsTipText
Returns the tip text for this property- 返回:
- 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.- 参数:
r
- true if cols are to be removed.
-
getRemoveAllMissingCols
public boolean getRemoveAllMissingCols()Returns whether columns containing all missing values are to be removed- 返回:
- true if columns are to be removed.
-
upperBoundMinSupportTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getUpperBoundMinSupport
public double getUpperBoundMinSupport()Get the value of upperBoundMinSupport.- 返回:
- Value of upperBoundMinSupport.
-
setUpperBoundMinSupport
public void setUpperBoundMinSupport(double v) Set the value of upperBoundMinSupport.- 参数:
v
- Value to assign to upperBoundMinSupport.
-
setClassIndex
public void setClassIndex(int index) Sets the class index- 指定者:
setClassIndex
在接口中CARuleMiner
- 参数:
index
- the class index
-
getClassIndex
public int getClassIndex()Gets the class index- 返回:
- the index of the class attribute
-
classIndexTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCar
public void setCar(boolean flag) Sets class association rule mining- 参数:
flag
- if class association rules are mined, false otherwise
-
getCar
public boolean getCar()Gets whether class association ruels are mined- 返回:
- true if class association rules are mined, false otherwise
-
carTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
lowerBoundMinSupportTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getLowerBoundMinSupport
public double getLowerBoundMinSupport()Get the value of lowerBoundMinSupport.- 返回:
- Value of lowerBoundMinSupport.
-
setLowerBoundMinSupport
public void setLowerBoundMinSupport(double v) Set the value of lowerBoundMinSupport.- 参数:
v
- Value to assign to lowerBoundMinSupport.
-
getMetricType
Get the metric type- 返回:
- the type of metric to use for ranking rules
-
metricTypeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMetricType
Set the metric type for ranking rules- 参数:
d
- the type of metric
-
minMetricTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMinMetric
public double getMinMetric()Get the value of minConfidence.- 返回:
- Value of minConfidence.
-
setMinMetric
public void setMinMetric(double v) Set the value of minConfidence.- 参数:
v
- Value to assign to minConfidence.
-
numRulesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNumRules
public int getNumRules()Get the value of numRules.- 返回:
- Value of numRules.
-
setNumRules
public void setNumRules(int v) Set the value of numRules.- 参数:
v
- Value to assign to numRules.
-
deltaTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getDelta
public double getDelta()Get the value of delta.- 返回:
- Value of delta.
-
setDelta
public void setDelta(double v) Set the value of delta.- 参数:
v
- Value to assign to delta.
-
significanceLevelTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSignificanceLevel
public double getSignificanceLevel()Get the value of significanceLevel.- 返回:
- Value of significanceLevel.
-
setSignificanceLevel
public void setSignificanceLevel(double v) Set the value of significanceLevel.- 参数:
v
- Value to assign to significanceLevel.
-
setOutputItemSets
public void setOutputItemSets(boolean flag) Sets whether itemsets are output as well- 参数:
flag
- true if itemsets are to be output as well
-
getOutputItemSets
public boolean getOutputItemSets()Gets whether itemsets are output as well- 返回:
- true if itemsets are output as well
-
outputItemSetsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setVerbose
public void setVerbose(boolean flag) Sets verbose mode- 参数:
flag
- true if algorithm should be run in verbose mode
-
getVerbose
public boolean getVerbose()Gets whether algorithm is run in verbose mode- 返回:
- true if algorithm is run in verbose mode
-
verboseTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getAllTheRules
returns all the rules- 返回:
- all the rules
- 另请参阅:
-
m_allTheRules
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中AbstractAssociator
- 返回:
- the revision
-
main
Main method.- 参数:
args
- the commandline options
-