Class Rule


  • public class Rule
    extends java.lang.Object
    This class represents a sequential rule found by the CMDeo algorithm.
    Author:
    Philippe Fournier-Viger
    See Also:
    AlgoCMDeogun, Itemset
    • Constructor Summary

      Constructors 
      Constructor Description
      Rule​(Itemset itemset1, Itemset itemset2)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getAbsoluteSupport​(int sequencecount)
      Get the support of this rule as a percentage.
      double getConfidence()
      Get the confidence of this rule.
      Itemset getItemset1()
      Get the antecedent of the rule (left itemset)
      Itemset getItemset2()
      Get the consequent of the rule (right itemset)
      double getLift​(int sequencecount)
      Get the lift of this rule.
      java.lang.String getLiftAsString​(int sequencecount)
      Get the lift of this rule.
      int getRelativeSupport()  
      void print()
      Print this rule to System.out
      java.lang.String toString()
      Get a string representation of this rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Rule

        public Rule​(Itemset itemset1,
                    Itemset itemset2)
        Constructor
        Parameters:
        itemset1 - the left itemset
        itemset2 - the right itemset
    • Method Detail

      • getItemset1

        public Itemset getItemset1()
        Get the antecedent of the rule (left itemset)
        Returns:
        an Itemset
      • getItemset2

        public Itemset getItemset2()
        Get the consequent of the rule (right itemset)
        Returns:
        an Itemset
      • getAbsoluteSupport

        public double getAbsoluteSupport​(int sequencecount)
        Get the support of this rule as a percentage.
        Parameters:
        sequencecount - the number of sequence in the sequence database
        Returns:
        the support as a double
      • getRelativeSupport

        public int getRelativeSupport()
      • getConfidence

        public double getConfidence()
        Get the confidence of this rule.
        Returns:
        a double value.
      • getLift

        public double getLift​(int sequencecount)
        Get the lift of this rule.
        Returns:
        a double value.
      • getLiftAsString

        public java.lang.String getLiftAsString​(int sequencecount)
        Get the lift of this rule. - TEMP!!
        Returns:
        a String value.
      • print

        public void print()
        Print this rule to System.out
      • toString

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