类 Apriori

所有已实现的接口:
Serializable, Cloneable, Associator, CARuleMiner, CapabilitiesHandler, OptionHandler, RevisionHandler, 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:

 @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)
另请参阅:
  • 字段详细资料

    • TAGS_SELECTION

      public static final Tag[] 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

      public String globalInfo()
      Returns a string describing this associator
      返回:
      a description of the evaluator suitable for displaying in the explorer/experimenter gui
    • getTechnicalInformation

      public TechnicalInformation 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

      public Capabilities getCapabilities()
      Returns default capabilities of the classifier.
      指定者:
      getCapabilities 在接口中 Associator
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 AbstractAssociator
      返回:
      the capabilities of this classifier
      另请参阅:
    • 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.
      指定者:
      buildAssociations 在接口中 Associator
      参数:
      instances - the instances to be used for generating the associations
      抛出:
      Exception - if rules can't be built successfully
    • mineCARs

      public FastVector[] mineCARs(Instances data) throws Exception
      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

      public Instances getInstancesNoClass()
      Gets the instances without the class atrribute.
      指定者:
      getInstancesNoClass 在接口中 CARuleMiner
      返回:
      the instances without the class attribute.
    • getInstancesOnlyClass

      public Instances getInstancesOnlyClass()
      Gets only the class attribute of the instances.
      指定者:
      getInstancesOnlyClass 在接口中 CARuleMiner
      返回:
      the class attribute of all instances.
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      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 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

      public String[] getOptions()
      Gets the current settings of the Apriori object.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      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.
      覆盖:
      toString 在类中 Object
      返回:
      a string representation of the model
    • metricString

      public String 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

      public String 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

      public String 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

      public String 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

      public String carTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • lowerBoundMinSupportTipText

      public String 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

      public SelectedTag getMetricType()
      Get the metric type
      返回:
      the type of metric to use for ranking rules
    • metricTypeTipText

      public String metricTypeTipText()
      Returns the tip text for this property
      返回:
      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
      参数:
      d - the type of metric
    • minMetricTipText

      public String 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

      public String 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

      public String 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

      public String 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

      public String 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

      public String verboseTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getAllTheRules

      public FastVector[] getAllTheRules()
      returns all the rules
      返回:
      all the rules
      另请参阅:
      • m_allTheRules
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 AbstractAssociator
      返回:
      the revision
    • main

      public static void main(String[] args)
      Main method.
      参数:
      args - the commandline options