Documentation of 'ca.pfv.spmf.algorithms.associationrules.TopKRules_and_TNR.RuleG' Java class
RuleG
ca.pfv.spmf.algorithms.associationrules.TopKRules_and_TNR

Class RuleG

  • All Implemented Interfaces:
    java.lang.Comparable<RuleG>


    public class RuleG
    extends java.lang.Object
    implements java.lang.Comparable<RuleG>
    This class represents an association rule found by the TNR or TopKRules algorithm for top-k association rule mining.

    This implementation is optimized for these algorithms. In particular, it stores the tidset of the rule and the tidset of the rule antecedent as bitsets. Furthermore, the antecedent and consequent are stored as array of integers. Lastly, for optimization, the maximum item id of the antecedent and consequent of the rule are precalculated and kept (as explained in the papers).
    See Also:
    AlgoTNR, AlgoTopKRules
    • Constructor Summary

      Constructors 
      Constructor and Description
      RuleG(java.lang.Integer[] itemset1, java.lang.Integer[] itemset2, int count, java.util.BitSet tids1, java.util.BitSet common, int maxLeft, int maxRight)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(RuleG o)
      Compare this rule with another rule "o".
      boolean equals(java.lang.Object o) 
      int getAbsoluteSupport()
      Get the support of this rule.
      double getConfidence()
      Get the confidence of this rule.
      java.lang.Integer[] getItemset1()
      Get the antecedent.
      java.lang.Integer[] getItemset2()
      Get the consequent.
      java.lang.String toString()
      Get a string representation of this rule.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • tids1

        public java.util.BitSet tids1
      • common

        public java.util.BitSet common
      • maxLeft

        public int maxLeft
      • maxRight

        public int maxRight
      • expandLR

        public boolean expandLR
    • Constructor Detail

      • RuleG

        public RuleG(java.lang.Integer[] itemset1,
                     java.lang.Integer[] itemset2,
                     int count,
                     java.util.BitSet tids1,
                     java.util.BitSet common,
                     int maxLeft,
                     int maxRight)
        Constructor
        Parameters:
        itemset1 - the left itemset
        itemset2 - the right itemset
        count - support of the rule
        tids1 - tidset of the antecedent
        common - tidset of the rule
        maxLeft - maximum item id in the antecedent
        maxRight - maximum item id in the consequent
    • Method Detail

      • getItemset1

        public java.lang.Integer[] getItemset1()
        Get the antecedent.
        Returns:
        an itemset
      • getItemset2

        public java.lang.Integer[] getItemset2()
        Get the consequent.
        Returns:
        an itemset
      • getAbsoluteSupport

        public int getAbsoluteSupport()
        Get the support of this rule.
        Returns:
        the support (integer)
      • getConfidence

        public double getConfidence()
        Get the confidence of this rule.
        Returns:
        the confidence (double)
      • compareTo

        public int compareTo(RuleG o)
        Compare this rule with another rule "o".
        Specified by:
        compareTo in interface java.lang.Comparable<RuleG>
        Returns:
        1 if this rule is larger, 0 if equal, or -1 if smaller. The comparison is done based on the support, then on the size of the antecedent, then on the size of the consequent, then on the confidence, then on the hashCodes.
      • equals

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Get a string representation of this rule.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.