Class AlgoTRuleGrowth


  • public class AlgoTRuleGrowth
    extends java.lang.Object
    This is the original implementation of the TRULEGROWTH algorithm for mining sequential rules with a window size constraint. The TRuleGrowth algorithm is a variation of the RuleGrowth algorithm described in this paper:

    Fournier-Viger, P., Wu, C.-W., Tseng, V.S., Nkambou, R. (2012). Mining Sequential Rules Common to Several Sequences with the Window Size Constraint. Proceedings of the 25th Canadian Conf. on Artificial Intelligence (AI 2012), Springer, LNAI 7310, pp.299-304.

    Author:
    Philippe Fournier-Viger
    See Also:
    Sequence, SequenceDatabase
    • Constructor Summary

      Constructors 
      Constructor Description
      AlgoTRuleGrowth()
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getTotalTime()
      Get the total runtime of the last execution.
      java.lang.String[] inputRules()  
      java.lang.String[] outputRules()  
      void printStats()
      Print statistics about the last algorithm execution to System.out.
      void runAlgorithm​(double minSupport, double minConfidence, java.lang.String input, java.lang.String output, int windowSize)
      Run the algorithm.
      void runAlgorithm​(java.lang.String input, java.lang.String output, int relativeMinSupport, double minConfidence, int windowSize)
      Run the algorithm.
      void setMaxAntecedentSize​(int maxAntecedentSize)
      Set the number of items that a rule antecedent should contain (optional).
      void setMaxConsequentSize​(int maxConsequentSize)
      Set the number of items that a rule consequent should contain (optional).
      • Methods inherited from class java.lang.Object

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

      • AlgoTRuleGrowth

        public AlgoTRuleGrowth()
        Default constructor
    • Method Detail

      • runAlgorithm

        public void runAlgorithm​(double minSupport,
                                 double minConfidence,
                                 java.lang.String input,
                                 java.lang.String output,
                                 int windowSize)
                          throws java.io.IOException
        Run the algorithm.
        Parameters:
        minSupport - Minsup as a percentage (ex: 0.05 = 5 %)
        minConfidence - minimum confidence (a value between 0 and 1).
        input - the input file path
        output - the output file path
        windowSize - a window size
        Throws:
        java.io.IOException - exception if there is an error reading/writing files
      • runAlgorithm

        public void runAlgorithm​(java.lang.String input,
                                 java.lang.String output,
                                 int relativeMinSupport,
                                 double minConfidence,
                                 int windowSize)
                          throws java.io.IOException
        Run the algorithm.
        Parameters:
        relativeMinSupport - the minsup parameter as a a relative value (integer)
        minConfidence - minimum confidence (a value between 0 and 1).
        input - the input file path
        output - the output file path
        windowSize - a window size
        Throws:
        java.io.IOException - exception if there is an error reading/writing files
      • inputRules

        public java.lang.String[] inputRules()
      • outputRules

        public java.lang.String[] outputRules()
      • setMaxAntecedentSize

        public void setMaxAntecedentSize​(int maxAntecedentSize)
        Set the number of items that a rule antecedent should contain (optional).
        Parameters:
        maxAntecedentSize - the maximum number of items
      • setMaxConsequentSize

        public void setMaxConsequentSize​(int maxConsequentSize)
        Set the number of items that a rule consequent should contain (optional).
        Parameters:
        maxConsequentSize - the maximum number of items
      • printStats

        public void printStats()
        Print statistics about the last algorithm execution to System.out.
      • getTotalTime

        public double getTotalTime()
        Get the total runtime of the last execution.
        Returns:
        the time as a double.