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

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

?? fpgrowth.cpp

?? 本人收集了一些關于關聯規則算法的小程序,供大家參考,不足之處,請大家提出寶貴意見,謝謝
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<fstream.h>#include<time.h>typedef struct FPnode *FPTreeNode;	/* Pointer to a FP-tree node */typedef struct Childnode *childLink;	/* Pointer to children of a FP-tree node */typedef struct Childnode {	FPTreeNode node;	/* A child node of an item */	childLink next;		/* Next child */} ChildNode;typedef struct FPnode {        int item;		        int count;			int numPath;  			FPTreeNode parent;	/* Pointer to parent node */        childLink children;	/* Pointer to children */        FPTreeNode hlink;	/* Horizontal link to next node with same item */} FPNode;typedef struct Itemsetnode *LargeItemPtr;typedef struct Itemsetnode {	int support;
	float corr;	int *itemset;	LargeItemPtr next;} ItemsetNode;		void FPgrowth(FPTreeNode T, FPTreeNode *headerTableLink, int headerSize, int *baseItems, int baseSize);LargeItemPtr *largeItemset;	int *numLarge;			int *support1;			int *largeItem1;	FPTreeNode root=NULL;		/* Initial FP-tree */FPTreeNode *headerTableLink;	/* Corresponding header table */int expectedK;			/* User input upper limit of itemset size to be mined */int realK;			/* Actual upper limit of itemset size can be mined */int threshold;			int numItem;			/* Number of items in the database */int numTrans;			/* Number of transactions in the database */float correlate;char *dataFile;		char *outFile;	time_t start,finish;float used_time;int findsup(int inputnum){	int i;	int j;	i=0;	j=0; for (i=0; i < numItem; i++)	if (largeItem1[i]==inputnum)	{				j=support1[i];		break;	} /*	support1[i] = 0;	largeItem1[i] = i;*/	  return j;}void destroyTree(FPTreeNode node){ childLink temp1, temp2; if (node == NULL) return; temp1 = node->children; while(temp1 != NULL) {	temp2 = temp1->next;	destroyTree(temp1->node);	free(temp1);	temp1 = temp2; } free(node); return;}void destroy(){ LargeItemPtr aLargeItemset;  int i; for (i=0; i < realK; i++) {	aLargeItemset = largeItemset[i];	while (aLargeItemset != NULL) {		largeItemset[i] = largeItemset[i]->next;		free(aLargeItemset->itemset);		free(aLargeItemset);		aLargeItemset = largeItemset[i];	} } free(largeItemset); free(numLarge);  free(headerTableLink); destroyTree(root); return;}void swap(int *support, int *itemset, int x, int i){  int temp;  temp = support[x]; support[x] = support[i]; support[i] = temp; temp = itemset[x]; itemset[x] = itemset[i]; itemset[i] = temp;  return;}void q_sortD(int *support, int *itemset, int low,int high, int size){ int pass; int highptr=high++;     /* highptr records the last element */ /* the first element in list is always served as the pivot */ int pivot=low; if(low>=highptr) return; do {	pass=1;	while(pass==1) {		if(++low<size) {			if(support[low] > support[pivot])				pass=1;			else pass=0;		} else pass=0;	} 	/* Find out, from the tail of support[], 	 * the 1st element value not smaller than the pivot's 	 */ 	pass=1; 	while(pass==1) {		if(high-->0) { 			if(support[high] < support[pivot]) 				pass=1;			else pass=0; 		} else pass=0; 	}	/* swap elements pointed by low pointer & high pointer */	if(low<high)		swap(support, itemset, low, high); } while(low<=high); swap(support, itemset, pivot, high); /* divide list into two for further sorting */  q_sortD(support, itemset, pivot, high-1, size);  q_sortD(support, itemset, high+1, highptr, size);  return;}void q_sortA(int *indexList, int *freqItemP, int low, int high, int size){ int pass; int highptr=high++;     /* highptr records the last element */ /* the first element in list is always served as the pivot */ int pivot=low; if(low>=highptr) return; do {        pass=1;        while(pass==1) {                if(++low<size) {                        if(indexList[low] < indexList[pivot])                                pass=1;                        else pass=0;                } else pass=0;        }        /* Find out, from the tail of indexList[],	 * 1st element value not larger than the pivot's 	 */        pass=1;        while(pass==1) {                if(high-->0) {                        if(indexList[high] > indexList[pivot])                                pass=1;                        else pass=0;                } else pass=0;        }        /* swap elements pointed by low pointer & high pointer */        if(low<high)                swap(indexList, freqItemP, low, high); } while(low<=high); swap(indexList, freqItemP, pivot, high); /* divide list into two for further sorting */ q_sortA(indexList, freqItemP, pivot, high-1, size); q_sortA(indexList, freqItemP, high+1, highptr, size); return;}void addToLargeList(int *pattern, int patternSupport, int index){ LargeItemPtr aLargeItemset; LargeItemPtr aNode, previous=NULL; int i,c1,c2; int temp=0;
 float cor;  /* Judge whether to add the itemset */ //printf("%d\n",pattern[0]);// printf("%d\n",pattern[index]); // printf("%d\n",temp);// temp=temp*correlate;
 //printf("%d\n",temp);	c1=findsup(pattern[0]);
	for (i=0;i<=index;i++)
	{
		c2=findsup(pattern[i]);
		if (c2>c1) c1=c2;	
	}
	temp=c1*correlate;
 if (patternSupport<=temp ) return;
	cor=float(patternSupport)/float(c1);

	

  /* Create a node to store the itemset */ aLargeItemset = (LargeItemPtr) malloc (sizeof(ItemsetNode)); if (aLargeItemset == NULL) {	printf("out of memory\n");	exit(1); } aLargeItemset->itemset = (int *) malloc (sizeof(int) * (index+1)); if (aLargeItemset->itemset == NULL) {	printf("out of memory\n");	exit(1); } /* Store the support of the itemset */ aLargeItemset->support = patternSupport;
 aLargeItemset->corr=cor; /* Store the items of the itemset */ for (i=0; i <= index; i++) {	aLargeItemset->itemset[i] = pattern[i]; } aLargeItemset->next = NULL; /* Assign aNode to point to the head of the resulting list */ aNode = largeItemset[index]; if (aNode == NULL) {	/* Case 1: The resulting list is empty */		largeItemset[index] = aLargeItemset; } else { 	while ((aNode != NULL) && (aNode->support > patternSupport)) {		previous = aNode;		aNode = aNode->next; 	}	/* Case 2: Insert between head and tail of the list */ 	if (previous != NULL) {		previous->next = aLargeItemset;		aLargeItemset->next = aNode;	} else {		/* Case 3: Append to the end of the list */		aLargeItemset->next = largeItemset[index];		largeItemset[index] = aLargeItemset;	} } (numLarge[index])++;  return;}void combine(int *itemList, int *support, int start, int itemListSize, int *base, int baseSize){ int *pattern; int i, j;  if (baseSize >= realK) return; if (start == itemListSize) return; /* Create an array of size (baseSize+1) to store any itemset formed from  * the union of *base and   * any item of *itemsetListSize from the position of start to the end  */ pattern = (int *) malloc (sizeof(int) * (baseSize+1)); if (pattern == NULL) {	printf("out of memory\n");	exit(1); } /* Insert all the items in base[] to pattern[]   */ for (j=0; j < baseSize; j++)	pattern[j] = base[j]; for (i=start; i < itemListSize; i++) {	/* Append an item, itemList[i], to pattern[] 	 */	pattern[baseSize] = itemList[i];	/* Insert pattern[] to the result list of large (baseSizes+1)-itemsets.	 * Support of this itemset = support[i] 	 */	addToLargeList(pattern , support[i], baseSize);	/* Form pattern[] with 	 * any item in *itemListSize from position (i+1) to the end of itemListSize	 */	combine(itemList, support, i+1, itemListSize, pattern, baseSize+1);	 } free(pattern);  return;}void insert_tree(int *freqItemP, int *indexList, int count, int ptr, int length, 			FPTreeNode T, FPTreeNode *headerTableLink, int *path)  { childLink newNode; FPTreeNode hNode; FPTreeNode hPrevious; childLink previous; childLink aNode; /* If all the items have been inserted */ if (ptr == length) return; /* Case 1 : If the current subtree has no children */ if (T->children == NULL) {	/* T has no children */	/* Create child nodes for this node */	newNode = (childLink) malloc (sizeof(ChildNode));	if (newNode == NULL) {		printf("out of memory\n");		exit(1);	}	/* Create a first child to store the item */	newNode->node = (FPTreeNode) malloc (sizeof(FPNode));	if (newNode->node == NULL) {		printf("out of memory\n");		exit(1);	}	/* Store information of the item */	newNode->node->item = freqItemP[ptr];	newNode->node->count = count;	newNode->node->numPath = 1;	newNode->node->parent = T;	newNode->node->children = NULL;	newNode->node->hlink = NULL;	newNode->next = NULL;	T->children = newNode;	/* Link the node to the header table */	hNode = headerTableLink[indexList[ptr]];	if (hNode == NULL) {		/* Place the node at the front of the horizontal link for the item */		headerTableLink[indexList[ptr]] = newNode->node;	} else {		/* Place the node at the end using the horizontal link */		while (hNode != NULL) {			hPrevious = hNode;			hNode = hNode->hlink;		}		hPrevious->hlink = newNode->node;	}	/* Insert next item, freqItemP[ptr+1], to the tree */	insert_tree(freqItemP, indexList, count, ptr+1, length, T->children->node, headerTableLink, path);	T->numPath += *path; } else {	aNode = T->children;	while ((aNode != NULL) && (aNode->node->item != freqItemP[ptr])) {		previous = aNode;		aNode = aNode->next;	}	if (aNode == NULL) {		/* Case 2: Create a new child for T */ 		newNode = (childLink) malloc (sizeof(ChildNode));		if (newNode == NULL) {			printf("out of memory\n");			exit(1);		}		newNode->node = (FPTreeNode) malloc (sizeof(FPNode));		if (newNode->node == NULL) {			printf("out of memory\n");			exit(1);		}		/* Store information of the item */		newNode->node->item = freqItemP[ptr];		newNode->node->count = count;		newNode->node->numPath = 1;		newNode->node->parent = T;		newNode->node->children = NULL;		newNode->node->hlink = NULL;		newNode->next = NULL;		previous->next = newNode;		/* Link the node to the header table */		hNode = headerTableLink[indexList[ptr]];		if (hNode == NULL) {			/* Place the node at the front of the horizontal link for the item */			headerTableLink[indexList[ptr]] = newNode->node;		} else {			/* Place the node at the end using the horizontal link */			while (hNode != NULL) {				hPrevious = hNode;				hNode = hNode->hlink;			}			hPrevious->hlink = newNode->node;		}		/* Insert next item, freqItemP[ptr+1], to the tree */		insert_tree(freqItemP, indexList, count, ptr+1, length, newNode->node, headerTableLink, path);		(*path)++;		T->numPath += *path;	} else {		aNode->node->count += count;		insert_tree(freqItemP, indexList, count, ptr+1, length, aNode->node, headerTableLink, path);		T->numPath += *path; 	} } return;}void buildtemptree(FPTreeNode *conRoot, FPTreeNode **conHeader, int conHeaderSize, int *conLargeItem,		int *conLargeItemSupport, FPTreeNode T, FPTreeNode *headerTable, int baseIndex, int headerSize){ FPTreeNode aNode; FPTreeNode ancestorNode; int *freqItemP;	 int *indexList;	 int path; int count; int i; /* create temp header table   */ *conHeader = (FPTreeNode *) malloc (sizeof(FPTreeNode) * conHeaderSize); if (*conHeader == NULL) {        printf("out of memory\n");        exit(1); } for (i=0; i < conHeaderSize; i++)        (*conHeader)[i] = NULL; /* create root of the temp FP-tree   */ (*conRoot) = (FPTreeNode) malloc (sizeof(FPNode)); if (*conRoot == NULL) {        printf("out of memory\n");        exit(1); } /* Initialize the root of the temp FP-tree   */ (*conRoot)->numPath = 1; (*conRoot)->parent = NULL; (*conRoot)->children = NULL; (*conRoot)->hlink = NULL; freqItemP = (int *) malloc (sizeof(int) * conHeaderSize); if (freqItemP == NULL) {        printf("out of memory\n");        exit(1); } indexList = (int *) malloc (sizeof(int) * conHeaderSize); if (indexList == NULL) {        printf("out of memory\n");        exit(1); } aNode = headerTable[baseIndex]; while (aNode != NULL) {	ancestorNode = aNode->parent;	count = 0;	while (ancestorNode != T) {		for (i=0; i < conHeaderSize; i++) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品二区第二页| 日韩黄色在线观看| 91在线你懂得| 亚洲欧美欧美一区二区三区| 激情综合一区二区三区| 精品国产免费一区二区三区香蕉| 美女免费视频一区二区| 精品国产一区二区三区av性色| 寂寞少妇一区二区三区| 亚洲国产高清在线观看视频| 91看片淫黄大片一级| 亚洲福利一二三区| 精品国精品国产| 成人黄色综合网站| 亚洲最新视频在线观看| 91精品国产日韩91久久久久久| 久久国产生活片100| 国产精品免费丝袜| 日韩一区二区三区在线| 成人黄页毛片网站| 免费在线观看成人| 亚洲欧洲日本在线| 91精品国产综合久久精品图片| 国产成人av在线影院| 亚洲国产人成综合网站| 中文字幕精品三区| 91精品国产色综合久久ai换脸| 不卡的av电影在线观看| 免费欧美日韩国产三级电影| 国产精品国产自产拍高清av| 国产精品久久久爽爽爽麻豆色哟哟| 欧美理论电影在线| 99re免费视频精品全部| 国产福利精品一区| 狠狠色丁香久久婷婷综合_中 | 美女视频黄免费的久久 | 欧美日韩国产高清一区二区三区| 99久久精品国产导航| 精品系列免费在线观看| 日本亚洲免费观看| 日韩成人伦理电影在线观看| 亚洲国产精品天堂| 日韩av网站在线观看| 夜夜精品视频一区二区| 一区二区三区欧美亚洲| 亚洲裸体xxx| 亚洲最色的网站| 亚洲精选视频在线| 亚洲第一福利一区| 奇米四色…亚洲| 韩国精品久久久| 国产精品羞羞答答xxdd| 成人在线一区二区三区| 成人午夜精品一区二区三区| 91无套直看片红桃| 欧美日本一区二区三区四区| 欧美另类高清zo欧美| 精品女同一区二区| 国产性天天综合网| 一区二区三区丝袜| 日韩国产精品大片| 高清在线不卡av| av综合在线播放| 欧美日高清视频| 国产日韩欧美一区二区三区综合| 国产精品国产三级国产| 亚洲一区二区三区视频在线播放| 日本欧美在线观看| 不卡的av网站| 精品国产91乱码一区二区三区| 国产精品久久久一本精品| 亚洲大片一区二区三区| 成人国产免费视频| 日韩一级免费观看| 亚洲综合在线电影| 国产成人综合在线播放| 99re热视频精品| 国产一区二区导航在线播放| 成人福利视频网站| 日韩一区和二区| 亚洲高清不卡在线| 成人黄页在线观看| 国产欧美日韩激情| 精东粉嫩av免费一区二区三区| 91久久精品一区二区二区| 欧美激情中文不卡| 国模无码大尺度一区二区三区| 欧美嫩在线观看| 一区二区三区欧美久久| 91丝袜美腿高跟国产极品老师 | 国内精品在线播放| 91精品福利在线一区二区三区| 亚洲精品免费播放| 色猫猫国产区一区二在线视频| 国产人伦精品一区二区| 国产成人一区在线| 亚洲视频网在线直播| a级高清视频欧美日韩| 国产精品久久久久aaaa樱花| 欧美在线一区二区| 亚洲日韩欧美一区二区在线| 99久久免费视频.com| 一区二区三区日韩精品| 在线日韩一区二区| 偷拍日韩校园综合在线| ww亚洲ww在线观看国产| 欧美一区二区三区成人| 国产精品自拍av| 亚洲成人在线免费| 久久青草欧美一区二区三区| 成人国产精品免费观看视频| 亚洲一区二区三区在线| 久久免费看少妇高潮| 色一情一乱一乱一91av| 日本欧美一区二区| 自拍偷自拍亚洲精品播放| 51久久夜色精品国产麻豆| 国产盗摄精品一区二区三区在线| 亚洲免费观看高清完整版在线观看 | 99国产精品久久久久| 日本强好片久久久久久aaa| 国产女人水真多18毛片18精品视频| heyzo一本久久综合| 麻豆91精品视频| 亚洲精选视频免费看| 久久青草国产手机看片福利盒子| 色94色欧美sute亚洲线路二| 国产一区二区在线观看免费| 亚洲高清久久久| 亚洲欧美日韩中文字幕一区二区三区| 日本aⅴ亚洲精品中文乱码| 一本一本久久a久久精品综合麻豆| 久久国产福利国产秒拍| 国产高清久久久| 在线亚洲欧美专区二区| 在线观看成人免费视频| 成人深夜福利app| 国产成人午夜电影网| 天堂在线一区二区| 亚洲人成网站在线| 国产精品初高中害羞小美女文| 欧美sm美女调教| 2021国产精品久久精品| 欧美成人猛片aaaaaaa| 欧美卡1卡2卡| 91精品国模一区二区三区| 欧美高清视频不卡网| 91精品啪在线观看国产60岁| 欧美日韩一级二级三级| 欧美一区二区啪啪| 久久人人爽人人爽| 亚洲一区二区不卡免费| 免费精品视频在线| 波多野结衣在线一区| 欧美在线一二三四区| 精品国产区一区| 亚洲综合区在线| 国产九色精品成人porny| 99天天综合性| 精品视频1区2区| 国产精品久久一级| 日韩电影一区二区三区四区| 国产成人综合精品三级| 色婷婷亚洲综合| 欧美国产一区二区在线观看| 亚洲成人在线网站| 91网站最新网址| 国产欧美日韩在线看| 免费的成人av| 在线精品视频一区二区| 国产精品国产自产拍高清av| 麻豆91精品视频| 蜜桃视频在线观看一区| 国产一区二区在线观看视频| 337p亚洲精品色噜噜噜| 日韩精品欧美精品| 欧美成人一级视频| 成人丝袜高跟foot| 1000部国产精品成人观看| 成人av网站在线观看免费| 中文字幕欧美日韩一区| 成人av资源在线观看| 日本一区二区三区四区| 成人福利视频网站| 国产调教视频一区| 国产一区二区福利视频| 久久新电视剧免费观看| 老司机午夜精品| 日韩一区二区不卡| 国产成人精品一区二| 久久久精品日韩欧美| 国产福利视频一区二区三区| 亚洲欧美视频在线观看| 欧美日韩视频第一区| 美脚の诱脚舐め脚责91| 国产农村妇女精品| 欧美综合一区二区三区| 免费高清视频精品| 国产精品热久久久久夜色精品三区| 色综合久久综合网欧美综合网|