/* -------------------------------------------------------------------------- */ /* */ /* TOTAL SUPPORT TREE NO X-CHECK */ /* */ /* Frans Coenen */ /* */ /* 22 July 2002 */ /* (Revised 16/1/2003, 3-7-2003, 1/7/2006) */ /* */ /* Department of Computer Science */ /* The University of Liverpool */ /* */ /* -------------------------------------------------------------------------- */ /* Structure: AssocRuleMining | +-- TotalSupportTree | +-- TotalSupportTreeNoXcheck */ //package lucsKDD_ARM; /* Java packages */ import java.io.*; // Java GUI packages import javax.swing.*; /** Methods to implement the "Apriori-T" algorithm using a "Total support" tree data structure (T-tree) but without X-checking.

X-checking is the process whereby, given a newly generated T-tree node, we check that all its size-1 subsets are supported before determining support for this node. If any of the subsets are not supported we do not need to continue to consider this node, however X-checking has a corresponding computational overhead associated with it which in some cases has an adverse effect on overall efficiency. @author Frans Coenen @version 3 July 2003 */ public class TotalSupportTreeNoXcheck extends TotalSupportTree { /* ------ FIELDS ------ */ /* None */ /* ------ CONSTRUCTORS ------ */ /** Processes command line arguments. */ public TotalSupportTreeNoXcheck(String[] args) { super(args); } /** With argument from existing instance of class AssocRuleMining. */ public TotalSupportTreeNoXcheck(AssocRuleMining armInstance) { super(armInstance); } /** Default constructor */ public TotalSupportTreeNoXcheck() { } /* ------ METHODS ------ */ /*----------------------------------------------------------------------- */ /* */ /* TREE BUILDING METHODS */ /* */ /*----------------------------------------------------------------------- */ /* CREATE TOTAL SUPPORT TREE */ /** Commences start process of generating a total support tree (T-tree).

Overridies parent method. */ public void createTotalSupportTree() { System.out.println("APRIORI-T no X-CHECKING\n" + "-----------------------"); System.out.println("Minimum support threshold = " + support + "% " + "(" + minSupport + " records)"); // Continue createTotalSupportTree2(); } /** Commences start process of generating a total support tree (T-tree), GUI version.

Overridies parent method. @param textArea the given instance of the class JTextArea. */ public void createTotalSupportTree(JTextArea textArea) { textArea.append("Minimum support threshold = " + support + "% " + "(" + minSupport + " records)\n"); // Continue createTotalSupportTree2(); } /** Continues start process of generating a total support tree (T-tree). */ private void createTotalSupportTree2() { // If no data (possibly as a result of an order and pruning operation // error) return if (numOneItemSets==0) return; // Set number of t-tree nodes to zero (this is a stic field do will not // be reset in repeat calls to the T-tree constructor). TtreeNode.setNumberOfNodesFieldToZero(); // Create Top level of T-tree (First pass of dataset) startTtreeRef=null; numFrequentSets = 0; numUpdates = 0l; double time1 = (double) System.currentTimeMillis(); // Create Top level of T-tree (First pass of dataset). createTtreeTopLevel(); // Parent method // Generate level 2 generateLevel2(); // Parent method // Further passes of the dataset createTtreeLevelN(); // Parent method duration = getDuration(time1,(double) System.currentTimeMillis()); } /*---------------------------------------------------------------------- */ /* */ /* LEVEL GENERATION */ /* */ /*---------------------------------------------------------------------- */ /* GENERATE NEXT LEVEL */ /** Completes process of generating remaining levels in the T-tree.

Overrides parent method which includes X-checking. @param parentRef the reference to the current sub-branch of T-tree (start at top of tree) @param endIndex the last index of the parent level. @param itemSet the complete label representing the current node (not used by this method, but required by the parent method which this method overwrites). */ protected void generateNextLevel(TtreeNode[] parentRef, int endIndex, short[] itemSet) { parentRef[endIndex].childRef = new TtreeNode[endIndex]; // New level // Generate a level in Ttree TtreeNode currentNode = parentRef[endIndex]; // Loop through parent sub-level of siblings upto current node for (int index=1;index