亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? totalsupporttree.java

?? apriori algorithm using datasets implementation
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
    set and test it. More generally we must test all cardinality-1 subsets
    which do not include the first element. This is done using the method 
    <TT>testCombinations</TT>. 
    </OL>
    <P>Example 2, given:
    <PRE>
    (A) ----- (D)
               |         
	       |         
	      (A) ----- (B) ----- (C)
	                           |
				   |
				  (A) ----- (B) 
    </PRE><P>	 
    where we wish to add a level 4 node (A) to (B) this would represent the
    complete label {D,C,B,A}, the N-1 subsets will then be {{D,C,B},{D,C,A},
    {D,B,A} and {C,B,A}}. We know the first two are supported because they are
    contained in the current sub-branch of the T-tree, {D,B,A} and {C,B,A} are
    not.
    </OL> 
    @param parentRef the reference to the level in the sub-branch of the T-tree
    under consideration.
    @param endIndex the index of the current node under consideration.
    @param itemSet the complete label represented by the current node (required
    to generate further itemsets to be X-checked). */
    
    protected void generateNextLevel(TtreeNode[] parentRef, int endIndex, 
    			short[] itemSet) {
	parentRef[endIndex].childRef = new TtreeNode[endIndex];	// New level
        short[] newItemSet;	
	// Generate a level in Ttree
	
	TtreeNode currentNode = parentRef[endIndex];
	
	// Loop through parent sub-level of siblings upto current node
	for (int index=1;index<endIndex;index++) {	
	    // Check if "uncle" element is supported (i.e. it exists) 
	    if (parentRef[index] != null) {	
		// Create an appropriate itemSet label to test
	        newItemSet = realloc2(itemSet,(short) index);
		if (testCombinations(newItemSet)) {
		    currentNode.childRef[index] = new TtreeNode();
		    nextLevelExists=true;
		    }
	        else currentNode.childRef[index] = null;
	        }
	    }
	}  
	
    /* TEST COMBINATIONS */
    
    /** Commences the process of testing whether the N-1 sized sub-sets of a 
    newly created T-tree node are supported elsewhere in the Ttree --- (a 
    process referred to as "X-Checking"). <P> Thus given a candidate large 
    itemsets whose size-1 subsets are contained (supported) in the current 
    branch of the T-tree, tests whether size-1 subsets contained in other 
    branches are supported. Proceed as follows:
    <OL>
    <LI> Using current item set split this into two subsets:
    <P>itemSet1 = first two items in current item set
    <P>itemSet2 = remainder of items in current item set
    <LI> Calculate size-1 combinations in itemSet2
    <LI> For each combination from (2) append to itemSet1 
    </OL>
    <P>Example 1: 
    <PRE>
    currentItemSet = {A,B,C} 
    itemSet1 = {B,A} (change of ordering)
    size = {A,B,C}-2 = 1
    itemSet2 = {C} (currentItemSet with first two elements removed)
    calculate combinations between {B,A} and {C}
    </PRE>
    <P>Example 2: 
    <PRE>
    currentItemSet = {A,B,C,D} 
    itemSet1 = {B,A} (change of ordering)
    itemSet2 = {C,D} (currentItemSet with first two elements removed)
    calculate combinations between {B,A} and {C,D}
    </PRE>
    @param currentItemSet the given itemset.		*/
    
    protected boolean testCombinations(short[] currentItemSet) {  
	// No need to test 1- and 2-itemsets
        if (currentItemSet.length < 3) return(true);
	   
	// Create itemSet1 (note ordering)
	
	short[] itemSet1 = new short[2];
	itemSet1[0] = currentItemSet[1];
	itemSet1[1] = currentItemSet[0];
	
	// Creat itemSet2
	
	int size = currentItemSet.length-2;
	short[] itemSet2 = removeFirstNelements(currentItemSet,2);
	
	// Calculate combinations

	return(combinations(null,0,2,itemSet1,itemSet2));
	}
	
    /* COMBINATIONS */
    
    /** Determines the cardinality N combinations of a given itemset and then
    checks whether those combinations are supported in the T-tree. <P> 
    Operates in a recursive manner.
    <P>Example 1: Given --- sofarSet=null, 
    startIndex=0, endIndex=2, itemSet1 = {B,A} and itemSet2 = {C}
    <PRE>
    itemSet2.length = 1
    endIndex = 2 greater than itemSet2.length if condition succeeds
    tesSet = null+{B,A} = {B,A}
    retutn true if {B,A} supported and null otherwise
    </PRE>
    <P>Example 2: Given --- sofarSet=null, 
    startIndex=0, endIndex=2, itemSet1 = {B,A} and itemSet2 = {C,D}
    <PRE>
    endindex not greater than length {C,D}
    go into loop
    tempSet = {} + {C} = {C}
    	combinations with --- sofarSet={C}, startIndex=1, 
			endIndex=3, itemSet1 = {B,A} and itemSet2 = {C}
	endIndex greater than length {C,D}
	testSet = {C} + {B,A} = {C,B,A}
    tempSet = {} + {D} = {D}
    	combinations with --- sofarSet={D}, startIndex=1, 
			endIndex=3, itemSet1 = {B,A} and itemSet2 = {C}
	endIndex greater than length {C,D}
	testSet = {D} + {B,A} = {D,B,A}
    </PRE>
    @param sofarSet The combination itemset generated so far (set to null at
    start)
    @param startIndex the current index in the given itemSet2 (set to 0 at 
    start).
    @param endIndex The current index of the given itemset (set to 2 at start)
    and incremented on each recursion until it is greater than the length of
    itemset2.
    @param itemSet1 The first two elements (reversed) of the total label for the
    current item set.
    @param itemSet2 The remainder of the current item set.
    */	
	
    private boolean combinations(short[] sofarSet, int startIndex,
    		    int endIndex, short[] itemSet1, short[] itemSet2) {
	// At level
	
	if (endIndex > itemSet2.length) {
	    short[] testSet = append(sofarSet,itemSet1);
	    // If testSet exists in the T-tree sofar then it is supported
	    return(findItemSetInTtree(testSet));
	    }
	
	// Otherwise
	else {
	    short[] tempSet;
	    for (int index=startIndex;index<endIndex;index++) {
	        tempSet = realloc2(sofarSet,itemSet2[index]);
	        if (!combinations(tempSet,index+1,endIndex+1,itemSet1,
				itemSet2)) return(false);
	        }
	    }						
        
	// Return
	
	return(true);
	}
    	
    /*---------------------------------------------------------------------- */
    /*                                                                       */
    /*                        T-TREE SEARCH METHODS                          */
    /*                                                                       */
    /*---------------------------------------------------------------------- */  
    
    /* FIND ITEM SET IN T-TREE*/
    
    /** Commences process of determining if an itemset exists in a T-tree. <P> 
    Used to X-check existence of Ttree nodes when generating new levels of the 
    Tree. Note that T-tree node labels are stored in "reverse", e.g. {3,2,1}. 
    @param itemSet the given itemset (IN REVERSE ORDER). 
    @return returns true if itemset found and false otherwise. */
    
    protected boolean findItemSetInTtree(short[] itemSet) {

    	// first element of itemset in Ttree (Note: Ttree itemsets stored in 
	// reverse)
  	if (startTtreeRef[itemSet[0]] != null) {
    	    int lastIndex = itemSet.length-1;
	    // If single item set return true
	    if (lastIndex == 0) return(true);
	    // Otherwise continue down branch
	    else if (startTtreeRef[itemSet[0]].childRef!=null) {
	        return(findItemSetInTtree2(itemSet,1,lastIndex,
			startTtreeRef[itemSet[0]].childRef));
	        }
	    else return(false);
	    }	
	// Item set not in Ttree
    	else return(false);
	}
    
    /** Returns true if the given itemset is found in the T-tree and false 
    otherwise. <P> Operates recursively. 
    @param itemSet the given itemset. 
    @param index the current index in the given T-tree level (set to 1 at
    start).
    @param lastIndex the end index of the current T-tree level.
    @param linRef the reference to the current T-tree level. 
    @return returns true if itemset found and false otherwise. */
     
    private boolean findItemSetInTtree2(short[] itemSet, int index, 
    			int lastIndex, TtreeNode[] linkRef) {  

        // Attribute at "index" in item set exists in Ttree
  	if (linkRef[itemSet[index]] != null) {
  	    // If attribute at "index" is last element of item set then item set
	    // found
	    if (index == lastIndex) return(true);
	    // Otherwise continue
	    else if (linkRef[itemSet[index]].childRef!=null) {
	        return(findItemSetInTtree2(itemSet,index+1,lastIndex,
	    		linkRef[itemSet[index]].childRef));
	        }
	    else return(false); 
	    }	
	// Item set not in Ttree
	else return(false);    
    	}

    /* GET SUPPORT FOT ITEM SET IN T-TREE */
    
    /** Commences process for finding the support value for the given item set
    in the T-tree. <P> Used when generating Association Rules (ARs). Note that
    itemsets are stored in reverse order in the T-tree therefore the given
    itemset must be processed in reverse. 
    @param itemSet the given itemset. 
    @return returns the support value (0 if not found). */
    
    protected int getSupportForItemSetInTtree(short[] itemSet) {
	int lastIndex = itemSet.length-1;
	
    	// Last element of itemset in Ttree (Note: Ttree itemsets stored in 
	// reverse)
  	if (startTtreeRef[itemSet[lastIndex]] != null) {
	    // If single item set return support
	    if (lastIndex == 0) return(startTtreeRef[itemSet[0]].support);
	    // Otherwise continue down branch
	    else return(getSupportForItemSetInTtree2(itemSet,lastIndex-1,
			startTtreeRef[itemSet[lastIndex]].childRef));
	    }	
	// Item set not in Ttree thererfore return 0
    	else return(0);
	}
    
    /** Returns the support value for the given itemset if found in the T-tree 
    and 0 otherwise. <P> Operates recursively. 
    @param itemSet the given itemset. 
    @param index the current index in the given itemset.
    @param linRef the reference to the current T-tree level. 
    @return returns the support value (0 if not found). */
     
    private int getSupportForItemSetInTtree2(short[] itemSet, int index, 
    			TtreeNode[] linkRef) {  

        // Element at "index" in item set exists in Ttree
  	if (linkRef[itemSet[index]] != null) {
  	    // If element at "index" is last element of item set then item set
	    // found
	    if (index == 0) return(linkRef[itemSet[0]].support);
	    // Otherwise continue
	    else return(getSupportForItemSetInTtree2(itemSet,index-1,
	    		linkRef[itemSet[index]].childRef));
	    }	
	// Item set not in Ttree therefore return 0
	else return(0);    
    	}
		
    /*----------------------------------------------------------------------- */
    /*                                                                        */
    /*                    ASSOCIATION RULE (AR) GENERATION                    */
    /*                                                                        */
    /*----------------------------------------------------------------------- */	
    
    /* GENERATE ASSOCIATION RULES */
    
    /** Initiates process of generating Association Rules (ARs) from a 
    T-tree. */
    
    public void generateARs() {
	// Command line interface output
	System.out.println("GENERATE ARs:\n-------------");
	
	// Set rule data structure to null
	currentRlist.startRulelist = null;
	
	// Generate
	generateARs2();
	}
	
    /** Loops through top level of T-tree as part of the AR generation 
    process. */
    
    private void generateARs2() {	
	// Loop	
	for (int index=1;index <= numOneItemSets;index++) {
	    if (startTtreeRef[index] !=null) {
	        if (startTtreeRef[index].support >= minSupport) {
	            short[] itemSetSoFar = new short[1];
		    itemSetSoFar[0] = (short) index;
		    generateARs(itemSetSoFar,index,
		    			startTtreeRef[index].childRef);
		    }
		}
	    } 
	}
		
    /* GENERATE ASSOCIATION RULES */
    
    /** Continues process of generating association rules from a T-tree by 
    recursively looping through T-tree level by level. 
    @param itemSetSofar the label for a T-tree node as generated sofar.
    @param size the length/size of the current array lavel in the T-tree.
    @param linkRef the reference to the current array level in the T-tree. */
    
    protected void generateARs(short[] itemSetSofar, int size,
    							TtreeNode[] linkRef) {
	
	// If no more nodes return	
	if (linkRef == null) return;
	
	// Otherwise process
	for (int index=1; index < size; index++) {
	    if (linkRef[index] != null) {
	        if (linkRef[index].support >= minSupport) {
		    // Temp itemset
		    short[] tempItemSet = realloc2(itemSetSofar,(short) index);
		    // Generate ARs for current large itemset
		    generateARsFromItemset(tempItemSet,linkRef[index].support);
	            // Continue generation process
		    generateARs(tempItemSet,index,linkRef[index].childRef); 
	            }
		}
	    }
	}
    
    /* GENERATE ASSOCIATION RULES */
    
    /** Generates all association rules for a given large item set found in a
    T-tree structure. <P> Called from <TT>generateARs</TT> method.
    @param itemSet the given large itemset.
    @param support the associated support value for the given large itemset. */
    
    private void generateARsFromItemset(short[] itemSet, double support) {
    	// Determine combinations
	short[][] combinations = combinations(itemSet);
	
	// Loop through combinations
	for(int index=0;index<combinations.length;index++) {
            // Find complement of combination in given itemSet
	    short[] complement = complement(combinations[index],itemSet);
	    // If complement is not empty generate rule
	    if (complement != null) {
	        double confidenceForAR = getConfidence(combinations[index],
		    						support);
		if (confidenceForAR >= confidence) {
		       currentRlist.insertRuleintoRulelist(combinations[index],
		     				   complement,confidenceForAR);
		    }
		} 
	    }
	}
	
    /*----------------------------------------------------------------------- */
    /*                                                                        */
    /*                                GET METHODS                             */
    /*                                                                        */
    /*----------------------------------------------------------------------- */
    
    /* GET CONFIDENCE */
    
    /** Calculates and returns the confidence for an AR given the antecedent
    item set and the support for the total item set.
    @param antecedent the antecedent (LHS) of the AR.
    @param support the support for the large itemset from which the AR is
    generated.
    @return the associated confidence value. */
    
    protected double getConfidence(short[] antecedent, double support) {
        // Get support for antecedent
        double supportForAntecedent = (double)
				getSupportForItemSetInTtree(antecedent);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看一区| 亚洲你懂的在线视频| 午夜精品福利一区二区三区蜜桃| 丁香一区二区三区| 国产亚洲精品福利| 国产又黄又大久久| 精品成a人在线观看| 免费观看日韩av| 欧美一区二区三级| 人禽交欧美网站| 欧美一级黄色大片| 麻豆精品国产91久久久久久| 欧美一区中文字幕| 麻豆91在线观看| 欧美电影免费观看高清完整版在 | 中文字幕不卡三区| 成人影视亚洲图片在线| 中文字幕乱码一区二区免费| 成人深夜在线观看| 亚洲人成电影网站色mp4| 色综合色狠狠综合色| 亚洲一区二区三区自拍| 欧美日韩精品一区二区天天拍小说| 亚洲国产视频一区| 日韩一区二区三区观看| 性久久久久久久久| 欧美老肥妇做.爰bbww| 国产精品久久三| 色妹子一区二区| 亚洲一区二区偷拍精品| 91精品福利在线一区二区三区| 黄网站免费久久| 国产女人18水真多18精品一级做 | 久久疯狂做爰流白浆xx| 日韩一级欧美一级| 国产成人免费视频一区| 亚洲少妇30p| 日韩一区二区不卡| 成人av免费观看| 午夜免费欧美电影| 久久夜色精品国产噜噜av| av电影天堂一区二区在线观看| 一区二区三区成人| 91精品一区二区三区久久久久久| 日本中文字幕一区二区视频| 久久久精品影视| 在线观看一区二区视频| 国产做a爰片久久毛片| 国产精品女上位| 欧美一区三区二区| 99麻豆久久久国产精品免费优播| 亚洲成a人v欧美综合天堂| 久久夜色精品一区| 欧美色偷偷大香| 国产成人亚洲综合a∨婷婷图片 | 调教+趴+乳夹+国产+精品| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美日韩免费不卡视频一区二区三区| 捆绑调教一区二区三区| 日韩伦理免费电影| 久久一区二区三区四区| 欧洲人成人精品| 九九热在线视频观看这里只有精品| 亚洲欧美日韩在线不卡| 在线观看日韩国产| 风间由美一区二区av101| 亚洲男人的天堂在线观看| 亚洲精品在线免费观看视频| 欧美在线一二三| 成人免费视频视频在线观看免费| 三级久久三级久久| |精品福利一区二区三区| 精品免费国产二区三区| 欧美视频中文字幕| av中文字幕亚洲| 裸体歌舞表演一区二区| 首页综合国产亚洲丝袜| 亚洲综合精品久久| 亚洲摸摸操操av| 国产精品天美传媒| 精品国产一区二区三区久久影院 | 精品处破学生在线二十三| 欧美探花视频资源| 99精品视频在线观看| 韩国三级电影一区二区| 青椒成人免费视频| 首页综合国产亚洲丝袜| 亚洲va欧美va人人爽| 国产精品视频免费| 国产精品丝袜黑色高跟| 久久久久久夜精品精品免费| 色天天综合久久久久综合片| 99国产精品久久久久久久久久| 福利电影一区二区| 国产馆精品极品| 国产69精品久久久久777| 国产精品正在播放| 国产宾馆实践打屁股91| 国产精品一二三区在线| 国产一区二区美女诱惑| 韩国女主播一区| 国产麻豆成人传媒免费观看| 韩国女主播成人在线| 国产91富婆露脸刺激对白| 成人午夜激情影院| 99久久精品久久久久久清纯| 不卡电影一区二区三区| 成人精品视频一区二区三区尤物| 欧美性猛交xxxxxx富婆| 欧美日韩国产色站一区二区三区| 欧洲色大大久久| 这里只有精品免费| 精品粉嫩超白一线天av| 国产欧美一区二区在线观看| 国产喷白浆一区二区三区| 国产日韩三级在线| 国产精品福利影院| 亚洲综合图片区| 亚洲成人久久影院| 美国十次了思思久久精品导航| 国产在线精品一区二区| 不卡一区二区在线| 在线观看亚洲一区| 精品国产一区二区国模嫣然| 久久美女高清视频| 亚洲免费视频中文字幕| 日韩成人一区二区| 国产成人在线免费观看| 欧美影院精品一区| 精品国产乱码久久久久久图片| 久久久久久久久久久久久久久99 | 夜夜嗨av一区二区三区| 亚洲成av人综合在线观看| 亚洲午夜国产一区99re久久| 久久国产精品色婷婷| 成人aa视频在线观看| 欧美日韩一区二区三区四区五区 | 播五月开心婷婷综合| 欧美在线高清视频| 日韩三级视频在线观看| 精品成人免费观看| 一色桃子久久精品亚洲| 伊人性伊人情综合网| 激情欧美日韩一区二区| 91色视频在线| 精品国产伦一区二区三区观看方式 | 欧美日韩日日摸| 国产清纯在线一区二区www| 午夜精品久久久久久久久| 大桥未久av一区二区三区中文| 色天使色偷偷av一区二区| 久久伊99综合婷婷久久伊| 亚洲成人一区二区| 国产成人av福利| 欧美日韩国产精选| 亚洲手机成人高清视频| 国产乱子轮精品视频| 欧美日韩电影在线播放| 亚洲欧洲av色图| 国精产品一区一区三区mba桃花| 欧美视频在线不卡| 欧美精品一区二区三区四区| 亚洲一级片在线观看| 麻豆中文一区二区| 在线观看国产精品网站| 国产欧美日韩麻豆91| 激情图片小说一区| 91麻豆精品国产91久久久久久| 中文字幕一区二区在线播放 | 国产精品久线在线观看| 韩国欧美一区二区| 精品少妇一区二区| 日韩高清电影一区| 欧美日韩国产一级二级| 亚洲女爱视频在线| 91丝袜美腿高跟国产极品老师 | 欧美巨大另类极品videosbest | 在线观看日韩av先锋影音电影院| 亚洲乱码国产乱码精品精小说 | 欧洲中文字幕精品| 污片在线观看一区二区| 欧美一区日韩一区| 国产久卡久卡久卡久卡视频精品| 国产日韩av一区二区| 国产传媒一区在线| 日韩美女精品在线| 欧美日韩成人高清| 久久er99精品| 国产精品情趣视频| 色先锋资源久久综合| 无吗不卡中文字幕| 久久久三级国产网站| 91在线精品秘密一区二区| 亚洲伊人色欲综合网| 欧美一区二区三区小说| 国产福利精品一区| 伊人性伊人情综合网| 日韩欧美久久一区| a4yy欧美一区二区三区| 亚洲国产另类av|