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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fpgrowth.cpp

?? 我編寫的能夠?qū)崿F(xiàn)頻繁關(guān)聯(lián)模式挖掘的FP-Growth數(shù)據(jù)挖掘算法。
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
#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++) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
悠悠色在线精品| 久久国产日韩欧美精品| 久久亚洲一区二区三区明星换脸 | 亚洲精品视频观看| 久久综合色8888| 欧美无砖专区一中文字| 国产成人自拍高清视频在线免费播放| 亚洲一区在线观看视频| 欧美高清在线一区二区| 欧美一级一区二区| 欧美日韩综合在线免费观看| 97精品久久久午夜一区二区三区 | 国产亚洲成av人在线观看导航| 欧美日韩不卡一区二区| 色综合久久综合| 成人av综合一区| 国产精品一区二区黑丝| 免费观看成人av| 午夜精品福利视频网站| 亚洲精品成人天堂一二三| 久久亚洲二区三区| 欧美成人精品高清在线播放| 欧美日韩国产大片| 色视频欧美一区二区三区| 不卡高清视频专区| 成人av网站大全| 不卡一卡二卡三乱码免费网站| 国产乱理伦片在线观看夜一区| 美腿丝袜一区二区三区| 日韩国产欧美在线播放| 视频在线在亚洲| 婷婷开心久久网| 日韩成人免费电影| 麻豆精品久久精品色综合| 日韩国产成人精品| 日韩av一区二| 精品中文字幕一区二区小辣椒| 久久99国产精品久久| 美女脱光内衣内裤视频久久网站| 日韩不卡免费视频| 精品亚洲欧美一区| 国产一区二区福利视频| 丁香婷婷综合五月| av综合在线播放| 在线观看日韩高清av| 欧美二区乱c少妇| 日韩亚洲欧美中文三级| 精品理论电影在线| 国产欧美一区二区精品婷婷 | 国产精品水嫩水嫩| 中文字幕一区视频| 亚洲欧美日韩国产一区二区三区 | 一区二区欧美在线观看| 亚洲国产精品一区二区www在线| 亚洲成人tv网| 久久99精品一区二区三区| 国产成人精品免费一区二区| av欧美精品.com| 欧美理论电影在线| 精品免费一区二区三区| 久久久不卡影院| 亚洲欧美日韩成人高清在线一区| 亚洲国产精品综合小说图片区| 日本视频免费一区| 成人午夜又粗又硬又大| 91豆麻精品91久久久久久| 欧美一区二区三区免费在线看 | 欧美一区二区三区四区五区| 国产视频一区二区在线| 国产精品视频九色porn| 亚洲国产精品久久艾草纯爱| 久久精品国产免费看久久精品| 国产不卡视频在线播放| 在线视频综合导航| 亚洲精品在线一区二区| 亚洲另类一区二区| 国模无码大尺度一区二区三区| 99这里只有久久精品视频| 欧美日韩国产成人在线免费| 国产欧美精品一区aⅴ影院 | 亚洲欧洲制服丝袜| 另类专区欧美蜜桃臀第一页| 99精品国产91久久久久久| 日韩欧美亚洲一区二区| 亚洲男帅同性gay1069| 蜜桃av一区二区| 在线视频欧美区| 久久久久久黄色| 午夜精品久久久久久久| av中文一区二区三区| 日韩精品中文字幕一区二区三区| 亚洲欧美一区二区三区久本道91| 寂寞少妇一区二区三区| 欧美制服丝袜第一页| 国产精品污www在线观看| 日本不卡一区二区| 99视频超级精品| 久久亚洲一区二区三区明星换脸 | 大白屁股一区二区视频| 欧美一区二区三区电影| 一区二区三区加勒比av| 国产成+人+日韩+欧美+亚洲| 日韩欧美综合在线| 亚洲影视在线播放| 99re8在线精品视频免费播放| 久久亚洲捆绑美女| 麻豆视频一区二区| 欧美日韩另类国产亚洲欧美一级| 中文字幕一区二区三区在线不卡| 久久99精品久久久久久久久久久久| 在线观看视频91| 最新热久久免费视频| 国产精品系列在线观看| 欧美xxx久久| 日本成人中文字幕| 欧美日韩电影一区| 亚洲第一成年网| 在线看国产一区| 亚洲卡通欧美制服中文| 91性感美女视频| 国产精品黄色在线观看| 国产suv精品一区二区883| 久久蜜臀中文字幕| 国产另类ts人妖一区二区| 欧美成人一区二区三区在线观看| 五月婷婷综合在线| 欧美日韩另类国产亚洲欧美一级| 一区二区三区四区亚洲| 色综合久久综合网| 亚洲另类中文字| 欧美在线视频日韩| 亚洲一区二区三区影院| 欧美日韩专区在线| 天堂成人免费av电影一区| 欧美日韩你懂得| 成人性生交大片免费看中文 | 欧美久久久久久久久| 午夜视频在线观看一区| 欧美日韩免费视频| 首页国产欧美久久| 欧美www视频| 国产一区二区剧情av在线| 国产亲近乱来精品视频| av一区二区不卡| 一卡二卡三卡日韩欧美| 欧美日韩在线播放三区| 日本视频在线一区| 久久色.com| 91在线小视频| 亚洲综合免费观看高清完整版在线| 欧美亚男人的天堂| 免费av成人在线| 久久久精品免费网站| 成人午夜激情在线| 一区二区三区日本| 欧美精品亚洲一区二区在线播放| 蜜桃一区二区三区在线| 久久精品综合网| 91麻豆swag| 三级欧美韩日大片在线看| 精品人伦一区二区色婷婷| 成人国产一区二区三区精品| 亚洲欧美日韩成人高清在线一区| 欧美日韩高清一区二区| 国产一区二区0| 亚洲欧美日韩小说| 日韩午夜av电影| 不卡av免费在线观看| 午夜精品久久久久久不卡8050| 欧美va亚洲va国产综合| 91在线观看视频| 日韩制服丝袜av| 国产欧美一区二区精品仙草咪| 在线精品亚洲一区二区不卡| 精品亚洲aⅴ乱码一区二区三区| 国产精品私人影院| 欧美一区二区三区在线| 国产精品国产自产拍高清av| 色欧美日韩亚洲| 久久99蜜桃精品| 亚洲女爱视频在线| 欧美精品一区二区三区在线播放| 91婷婷韩国欧美一区二区| 麻豆精品国产91久久久久久 | 麻豆成人在线观看| 日韩一区中文字幕| 欧美变态凌虐bdsm| 91精品福利在线| 国产伦精品一区二区三区视频青涩 | 午夜国产精品一区| 中文乱码免费一区二区| 欧美精品日韩精品| 成人在线视频首页| 久久国产剧场电影| 亚洲第一会所有码转帖| 中文字幕永久在线不卡| 久久久噜噜噜久久人人看| 欧美日韩精品高清| 97久久精品人人澡人人爽| 国产传媒欧美日韩成人|