Documentation of 'ca.pfv.spmf.algorithms.sequential_rules.topseqrules_and_tns.Rule' Java class
Rule
ca.pfv.spmf.algorithms.sequential_rules.topseqrules_and_tns

Class Rule

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


    public class Rule
    extends java.lang.Object
    implements java.lang.Comparable<Rule>
    This class represent a sequential rule as output by the TNS and TopSeqRules algorithm.

    It is optimized for these algorithms by storing several additional fields that are necessary for such top-k algorithms. For example, a rule includes the transactions IDs of the antecedent, the transaction IDs of the consequent, the transaction IDs of the sequences where the antecedent appears before the consequent, maps of occurences for the antecedent and consequent, etc.
    See Also:
    AlgoTopSeqRules, AlgoTNS
    • Constructor Summary

      Constructors 
      Constructor and Description
      Rule(int[] itemset1, int[] itemset2, double confidence, int transactioncount, java.util.Set<java.lang.Integer> tidsI, java.util.Set<java.lang.Integer> tidsJ, java.util.Set<java.lang.Integer> tidsIJ, java.util.Map<java.lang.Integer,java.lang.Short> occurencesIfirst, java.util.Map<java.lang.Integer,java.lang.Short> occurencesJlast)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(Rule o)
      Compare this rule to another rule
      boolean equals(java.lang.Object o)
      Check if this rule is equal to another (if they have the same items in their antecedent and consequent).
      int getAbsoluteSupport()
      Get the absolute support (a number of sequences)
      double getConfidence()
      Get the confidence of this rule
      int[] getItemset1()
      Get the antecedent itemset.
      int[] getItemset2()
      Get the consequent itemset.
      double getRelativeSupport(int sequencecount)
      Get the relative support (a percentage)
      void print()
      Print this rule to the console
      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
    • Constructor Detail

      • Rule

        public Rule(int[] itemset1,
                    int[] itemset2,
                    double confidence,
                    int transactioncount,
                    java.util.Set<java.lang.Integer> tidsI,
                    java.util.Set<java.lang.Integer> tidsJ,
                    java.util.Set<java.lang.Integer> tidsIJ,
                    java.util.Map<java.lang.Integer,java.lang.Short> occurencesIfirst,
                    java.util.Map<java.lang.Integer,java.lang.Short> occurencesJlast)
        Constructor
        Parameters:
        itemset1 - antecedent
        itemset2 - consequent
        confidence - confidence of the rule
        transactioncount - absolute support
        tidsI - the transaction IDs of the antecedent
        tidsJ - the transaction IDs of the consequent
        tidsIJ - transaction IDs of the sequences where the antecedent appears before the consequent
        occurencesIfirst - maps of first occurences of the antecedent
        occurencesJlast - maps of last occurences of the antecedent
    • Method Detail

      • getItemset1

        public int[] getItemset1()
        Get the antecedent itemset.
        Returns:
        the antecedent.
      • getItemset2

        public int[] getItemset2()
        Get the consequent itemset.
        Returns:
        the consequent.
      • getAbsoluteSupport

        public int getAbsoluteSupport()
        Get the absolute support (a number of sequences)
        Returns:
        the absolute support
      • getRelativeSupport

        public double getRelativeSupport(int sequencecount)
        Get the relative support (a percentage)
        Parameters:
        sequencecount - the number of sequence in the original sequence database
        Returns:
        the relative support
      • print

        public void print()
        Print this rule to the console
      • toString

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

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

        public int compareTo(Rule o)
        Compare this rule to another rule
        Specified by:
        compareTo in interface java.lang.Comparable<Rule>
        Returns:
        0 if equal, 0< if smaller or >0 if larger
      • equals

        public boolean equals(java.lang.Object o)
        Check if this rule is equal to another (if they have the same items in their antecedent and consequent).
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if equal

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.