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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? aprioriview.cpp

?? 本代碼實(shí)現(xiàn)了數(shù)據(jù)挖掘中的一個(gè)經(jīng)典算法Aprioris 。在此算法中
?? CPP
字號(hào):
// AprioriView.cpp : implementation of the CAprioriView class
//

#include "stdafx.h"
#include "Apriori.h"
#include "time.h"
#include "AprioriSet.h"
#include "AprioriDoc.h"
#include "AprioriView.h"
#include "SetPara.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAprioriView
IMPLEMENT_DYNCREATE(CAprioriView, CRecordView)

BEGIN_MESSAGE_MAP(CAprioriView, CRecordView)
	//{{AFX_MSG_MAP(CAprioriView)
	ON_BN_CLICKED(IDC_Bn_FreqItem, OnBnFreqItem)
	ON_COMMAND(ID_Parameter, OnParameter)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAprioriView construction/destruction

CAprioriView::CAprioriView()
	: CRecordView(CAprioriView::IDD)
{
	//{{AFX_DATA_INIT(CAprioriView)
	m_pSet = NULL;
	nAllFreqItem=0;

	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CAprioriView::~CAprioriView()
{
}

void CAprioriView::DoDataExchange(CDataExchange* pDX)
{
	CRecordView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAprioriView)

	DDX_Control(pDX, IDC_List_FreqItem, m_List_FreqItem);

	//}}AFX_DATA_MAP
}

BOOL CAprioriView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CRecordView::PreCreateWindow(cs);
}

void CAprioriView::OnInitialUpdate()
{
	m_pSet = &GetDocument()->m_aprioriSet;
	CRecordView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();

}

/////////////////////////////////////////////////////////////////////////////
// CAprioriView printing

BOOL CAprioriView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CAprioriView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CAprioriView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CAprioriView diagnostics

#ifdef _DEBUG
void CAprioriView::AssertValid() const
{
	CRecordView::AssertValid();
}

void CAprioriView::Dump(CDumpContext& dc) const
{
	CRecordView::Dump(dc);
}

CAprioriDoc* CAprioriView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAprioriDoc)));
	return (CAprioriDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAprioriView database support
CRecordset* CAprioriView::OnGetRecordset()
{
	return m_pSet;
}


/////////////////////////////////////////////////////////////////////////////
// CAprioriView message handlers

void CAprioriView::OnBnFreqItem() 
{
	// TODO: Add your control notification handler code here
	int nFieldCount=m_pSet->GetODBCFieldCount();
	int nDbCount;
	CString strValue;
	CString strIntToString="";

	clock_t start,stop,tick;
	double timeused;
	int nLargeCount=0;
	int nListFreqItemCount=0;
    start=clock();
	ClearItem();
	
    m_List_FreqItem.InsertColumn(0,"Item",LVCFMT_LEFT,100);
	m_List_FreqItem.InsertColumn(1,"Count",LVCFMT_LEFT,100);
    
	 
	if (nItemCount<=0)
	{
		MessageBox("請(qǐng)先進(jìn)行參數(shù)設(shè)置",NULL,MB_OK);
	    return;
	}

	FindLargeItem();

    for(int k=1;LargeItemCount[k-1]!=0;k++)
	{    
	     
		 AprioriGen(k,1);
		
		//初始化數(shù)組
		for(int mm=0;mm<CandLargeItemCount[k];mm++)
		{	
				nCountCand[mm]=0;
		}
		
        m_pSet->MoveFirst();
		nDbCount=0;

		while(!m_pSet->IsEOF()) 
		{   
		  	
			TransGenCand(k,nDbCount);
        		
		//統(tǒng)計(jì)計(jì)數(shù)
			for(int jj=0;jj<nTransCandCount;jj++)
		   		for(int jj1=0;jj1<CandLargeItemCount[k];jj1++)
				{   

					if(TransGenCandFreq[jj].Find(CandLargeItem[k][jj1])!=-1) 
					{ 	
					nCountCand[jj1]++;
					 break;
					}
				}
		  
			nDbCount++;
		  
			m_pSet->MoveNext(); 
			
		}
		
	     ShowFreqItem(k);


	}
	stop=clock();

	tick=stop - start;
    timeused=(double)tick/CLK_TCK;
	strIntToString="";
	strIntToString.Format("%s%f",strIntToString,timeused);
	MessageBox(strIntToString,NULL,MB_OK);
}
         
	


void CAprioriView::ClearItem()
{   
	//清除列表顯示的內(nèi)容
    m_List_FreqItem.DeleteAllItems ();
	while(m_List_FreqItem.DeleteColumn (0));
	UpdateWindow();
	for(int kk=0;kk<nMaxSize;kk++)
	    LargeItemCount[kk]=0;
	for(int kk1=0;kk1<nMaxSize;kk1++)
		for(int kk2=0;kk2<nMaxSize;kk2++)
			LargeItem[kk1][kk2]="";

}



void CAprioriView::AprioriGen(int nCandFreqItem, int nMinSupp)
{
	//由L(k-1)生成C(k)
	CString strTemp1,strTemp2,strRightTemp1,strRightTemp2;
	CString strTemp,strLeftTemp1,strLeftTemp2;
	int nstrTemp1,nstrTemp2;
    int nCandFreqItemCount=0;
	strTemp1="";
	strTemp2="";
	strRightTemp1="";
	strRightTemp2="";
	strTemp="";
	strLeftTemp1="";
    strLeftTemp2="";
	nstrTemp1=0;
	nstrTemp2=0;
	nAllFreqItem=nAllFreqItem + LargeItemCount[nCandFreqItem-1];
	for(int i1=0;i1<LargeItemCount[nCandFreqItem-1];i1++)
	{
		
		//strTemp1=strCandFreqItem[i1];
        strTemp1=LargeItem[nCandFreqItem -1][i1]; 
		nstrTemp1=strTemp1.ReverseFind(',');
		strRightTemp1=strTemp1.Right(strTemp1.GetLength ()-nstrTemp1-1);
	    strLeftTemp1=strTemp1.Left(nstrTemp1);
		

		for(int j1=i1+1;j1<LargeItemCount[nCandFreqItem-1];)
		{
			//strTemp2=strCandFreqItem[j1];
			strTemp2=LargeItem[nCandFreqItem-1][j1];
			nstrTemp2=strTemp2.ReverseFind (',');
			strRightTemp2=strTemp2.Right(strTemp2.GetLength ()-nstrTemp2-1);
			strLeftTemp2=strTemp2.Left(nstrTemp2) ;
		

			if((strLeftTemp1==strLeftTemp2)&&(strRightTemp1<strRightTemp2))
			{
				strTemp=strTemp1+','+strRightTemp2;

				if(Prune(nCandFreqItem,strTemp))
				{	CandLargeItem[nCandFreqItem][nCandFreqItemCount++]=strTemp;
		   	
					j1++;
				}
				else
				{
					j1++;

				}
			}
			else 
				break;
		}
		
	}
    
	CandLargeItemCount[nCandFreqItem]=nCandFreqItemCount;
    

}

void CAprioriView::SubItemGen(int strSubItemCount,CString strSubItem)
{//對(duì)每個(gè)事務(wù)分解成單個(gè)項(xiàng)目
	CString strTemp1;
	CString strTempSubItem[10];
	CString strReverse;
	
	int nSubItemCount;
	int nstrRightTemp1;
	int nTempCount;

	strTemp1=strSubItem;
	nSubItemCount=0;
	while((nstrRightTemp1=strTemp1.ReverseFind(','))!=-1)
	{
		nTempCount=strTemp1.GetLength() - nstrRightTemp1 - 1; 
		strTempSubItem[nSubItemCount++]=strTemp1.Right( nTempCount);
		strTemp1=strTemp1.Left(nstrRightTemp1);
	}
    strTempSubItem[nSubItemCount++]=strTemp1;
	for(int i2=0;i2<nSubItemCount/2;i2++)
	{
		strReverse=strTempSubItem[nSubItemCount-i2-1];
		strTempSubItem[nSubItemCount- i2-1]=strTempSubItem[i2];
		strTempSubItem[i2]=strReverse;
	}
    
     for(int i1=0;i1<nSubItemCount;i1++)
	 { 
		 DbItem[strSubItemCount][i1]=strTempSubItem[i1];
	    
   
	 }
	 DbItemCount[strSubItemCount]=nSubItemCount;
    
}

void CAprioriView::FindLargeItem()
{
	//顯示1-頻繁項(xiàng)目集
	int nFieldCount=m_pSet->GetODBCFieldCount();
	int nCount=0;
	int nFreqItem[100];
	
    int nDbCount=0;
	CString strInit;
	CString strValue;
	CString strIntToString;
  // 初始化候選項(xiàng)目集	
    for(int nInitCount=0;nInitCount<nItemCount;nInitCount++)
	{   
		strInit="";
		strInit.Format("%s%d",strInit,nInitCount+1); 
		CandLargeItem[0][nInitCount]='I'+strInit;

	}
//初始化數(shù)組
	for(int ii=0;ii<nItemCount;ii++)
		nFreqItem[ii]=0;
	
	m_pSet->MoveFirst ();
	while(!m_pSet->IsEOF())
	{
		for(int j=1;j<nFieldCount;j++){
			m_pSet->GetFieldValue(j,strValue);
            SubItemGen(nDbCount++ ,strValue);
		
			for(int i=0;i<nItemCount;i++)
				if(strValue.Find(CandLargeItem[0][i])!=-1)
					nFreqItem[i]++;
				
			
		}
		m_pSet->MoveNext();
	}

	nDbItemCount=nDbCount;


    for(int i1=0;i1<nItemCount;i1++)
	{  strIntToString="";
	   if(double(nFreqItem[i1])/double(nDbItemCount)>=dItemSupp)
		{  
		    LargeItem[0][nCount]=CandLargeItem[0][i1];
		    m_List_FreqItem.InsertItem(nCount,strIntToString);
			m_List_FreqItem.SetItemText(nCount,0,LargeItem[0][nCount]);
	        strIntToString="";
			strIntToString.Format("%s%d",strIntToString,nFreqItem[i1]);
			m_List_FreqItem.SetItemText(nCount,1,strIntToString);
			nCount++;
		}

	}
	LargeItemCount[0]=nCount;


}

void CAprioriView::OnParameter() 
{
	// TODO: Add your command handler code here
CSetPara dlg;
dlg.m_ItemCount =10;
dlg.m_Item_Supp=0.2; 
int ren=dlg.DoModal(); 
nItemCount=dlg.m_ItemCount;
dItemSupp=dlg.m_Item_Supp ;
	
}

BOOL CAprioriView::Prune(int nCandFreqItemCount,CString strCandFreqItem)
{
	CString strTemp1;
	CString strTempSubItem[nMaxSize];
	CString strReverse;
	CString strSubCandFreqItem[nMaxSize];//分解候選項(xiàng)目
	CString strSubTemp="";
	CString strSubTemp1;
	int nSubFreqItemCount=0;//統(tǒng)計(jì)分解候選項(xiàng)目的個(gè)數(shù)
	int nSubItemCount;
	int nstrRightTemp1;
	int nTempCount;
	int nPruneCount=0;

	strTemp1=strCandFreqItem;
	nSubItemCount=0;
	while((nstrRightTemp1=strTemp1.ReverseFind(','))!=-1)
	{
		nTempCount=strTemp1.GetLength() - nstrRightTemp1 - 1; 
		strTempSubItem[nSubItemCount++]=strTemp1.Right( nTempCount);
		strTemp1=strTemp1.Left(nstrRightTemp1);
	}
    strTempSubItem[nSubItemCount++]=strTemp1;
	for(int i2=0;i2<nSubItemCount/2;i2++)
	{
		strReverse=strTempSubItem[nSubItemCount-i2-1];
		strTempSubItem[nSubItemCount- i2-1]=strTempSubItem[i2];
		strTempSubItem[i2]=strReverse;
	}
	
	
	for(int i3=nSubItemCount-1;i3>=0;i3--)
	{   
		strSubTemp1=strTempSubItem[i3];
		strSubTemp.Empty(); 
		for(int i4=0;i4<nSubItemCount;i4++)
			if(strSubTemp1!=strTempSubItem[i4])
            {
				strSubTemp=strSubTemp+strTempSubItem[i4]+',';
				
			}
			strSubCandFreqItem[nSubFreqItemCount++] = strSubTemp.Left(strSubTemp.GetLength()-1); 
	}

	for(int i5=0;i5<nSubFreqItemCount;i5++)
	{   
		for(int i6=0;i6<LargeItemCount[nCandFreqItemCount-1];i6++)
		   if(strSubCandFreqItem[i5].Find(LargeItem[nCandFreqItemCount-1][i6])>=0)
			      nPruneCount++;
	}
	if(nPruneCount==nSubItemCount)
	{
	
		return TRUE;
	}
	
	return FALSE;

}


void CAprioriView::TransGenCand(int nCandFreqItem,int nCurrentCount )
{
	CString strTransTemp;
	CString strTransTemp1;
    nTransCandCount=0;
	int nCurrentTempCount=nCurrentCount;
	int a[nMaxSize];
	int nCount=0;
	a[nCount]=0;
	//初始化數(shù)組
	for(int nTransCand=0;nTransCand<nMaxSize;nTransCand++)
	{TransGenCandFreq[nTransCand]="";
	}
	do{	
		
		if((a[nCount]-nCount) <= (DbItemCount[nCurrentTempCount]- nCandFreqItem -1))
		{
			if(nCount==nCandFreqItem)
			{   
				strTransTemp="";
				for(int jj=0;jj<nCandFreqItem;jj++)
					strTransTemp=strTransTemp+DbItem[nCurrentTempCount][a[jj]]+',';
				
				strTransTemp1="";
				strTransTemp1=strTransTemp+DbItem[nCurrentTempCount][a[nCandFreqItem]];
			    TransGenCandFreq[nTransCandCount++]=strTransTemp1;
			   // MessageBox(strTransTemp1);
			     a[nCount]++;
				 continue;
			}
			nCount++;
			a[nCount]=a[nCount-1]+1;
		}
		else
		{
			if(nCount==0) return;
			a[--nCount]++;
		}
	}while(1);


//	for(int ll=0;ll<nTransCandCount;ll++)
//			MessageBox(TransGenCandFreq[ll],NULL,MB_OK);

    
 
}

void CAprioriView::ShowFreqItem(int nScanCount)
{	CString strIntToString="";
    CString strValue;
	CString strjj3[2];
	int nLargeCount=-1;
	int nLargeItemCount=0;
	
   	//以下為求頻繁項(xiàng)目集
	int k,nListFreqItemCount;
	k=nScanCount;  
	nListFreqItemCount=LargeItemCount[k-1];
	m_List_FreqItem.InsertItem(0,strValue);
	m_List_FreqItem.SetItemText(0,0,"-----------"); 
    m_List_FreqItem.SetItemText(0,1,"-----------"); 
	for(int jj2=0;jj2<CandLargeItemCount[k];jj2++)
		if(double(nCountCand[jj2])/double(nDbItemCount)>=dItemSupp)
		{
			LargeItem[k][nLargeItemCount++]=CandLargeItem[k][jj2];
			nLargeCount++;
			
			strjj3[1]=strIntToString;	
			strjj3[0]=CandLargeItem[k][jj2];
			strIntToString="";
			strIntToString.Format("%s%d",strIntToString,nCountCand[jj2]);
	     	strjj3[1]=strIntToString;
			
			m_List_FreqItem.InsertItem(nLargeCount,strValue);
			
			m_List_FreqItem.SetItemText(nLargeCount,0,LargeItem[k][nLargeItemCount-1]);
			m_List_FreqItem.SetItemText(nLargeCount,1,strIntToString);



			UpdateWindow(); 
			}
		
	        //復(fù)制頻繁項(xiàng)目個(gè)數(shù)
		  LargeItemCount[k]=nLargeItemCount;

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区有码在线| 极品少妇xxxx偷拍精品少妇| √…a在线天堂一区| 亚洲123区在线观看| 亚洲国产精品天堂| 香蕉加勒比综合久久| 午夜一区二区三区在线观看| 亚洲午夜精品网| 日韩二区三区四区| 美女视频黄免费的久久| 极品少妇xxxx偷拍精品少妇| 国模无码大尺度一区二区三区| 韩国v欧美v日本v亚洲v| 国产精品白丝av| 成人avav在线| 欧美在线观看一区| 69p69国产精品| 久久综合99re88久久爱| 国产精品日韩精品欧美在线| 综合婷婷亚洲小说| 亚洲大片一区二区三区| 青娱乐精品在线视频| 激情久久五月天| 成人h动漫精品一区二区| 91视频com| 91精品国产综合久久香蕉麻豆| 欧美成人高清电影在线| 国产欧美精品在线观看| 尤物av一区二区| 免费在线观看精品| 懂色av一区二区夜夜嗨| 在线欧美小视频| 欧美变态tickling挠脚心| 日本一区二区不卡视频| 亚洲香蕉伊在人在线观| 精一区二区三区| jlzzjlzz亚洲日本少妇| 欧美日韩美少妇 | 国产亚洲自拍一区| 亚洲视频一二三区| 日韩和的一区二区| 粉嫩在线一区二区三区视频| 欧美亚洲综合一区| 久久久不卡网国产精品一区| 亚洲精品v日韩精品| 久久99九九99精品| 色哟哟日韩精品| 亚洲影院免费观看| 久久精品国产成人一区二区三区 | 欧美精品tushy高清| 久久久久一区二区三区四区| 亚洲欧美另类综合偷拍| 蜜臀av性久久久久蜜臀aⅴ| www.av亚洲| 日韩一级免费一区| 亚洲男人电影天堂| 另类欧美日韩国产在线| 在线观看网站黄不卡| 精品99久久久久久| 亚洲一区在线播放| 国产成人精品免费| 91精品国产高清一区二区三区蜜臀 | 色婷婷精品久久二区二区蜜臀av| 欧美一区二区久久| 亚洲免费在线看| 国产精品一区免费在线观看| 精品视频在线免费观看| 国产精品入口麻豆原神| 狠狠色2019综合网| 欧美精品v国产精品v日韩精品 | www激情久久| 日韩精品成人一区二区三区| av电影天堂一区二区在线| 日韩写真欧美这视频| 亚洲午夜久久久久久久久电影院| 国产成人av电影在线播放| 日韩欧美一区二区免费| 亚洲一本大道在线| 91视频com| 国产精品你懂的在线| 国产在线不卡一区| 欧美一区二区精品在线| 天天操天天干天天综合网| 91色九色蝌蚪| 国产精品高潮呻吟| 国产电影精品久久禁18| 精品国产免费人成电影在线观看四季| 亚洲高清在线精品| 欧洲精品视频在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国内精品久久久久影院薰衣草| 91麻豆精品国产自产在线观看一区 | 午夜久久久久久电影| 在线精品视频免费观看| 亚洲欧美日韩国产中文在线| 久久这里只精品最新地址| 日韩精品一卡二卡三卡四卡无卡| 欧洲精品中文字幕| 一区二区成人在线| 在线欧美日韩精品| 亚洲午夜激情网站| 欧美日韩在线播放一区| 亚洲第一成人在线| 欧美福利视频导航| 日韩电影在线观看网站| 7777精品伊人久久久大香线蕉超级流畅 | 久久久99久久| 国产精品91xxx| 中文字幕国产一区二区| www.av精品| 一区二区三区毛片| 欧美日韩一区二区在线视频| 亚洲成在线观看| 在线播放日韩导航| 美女视频网站久久| 精品国精品自拍自在线| 国产精品一二三| 国产精品高潮呻吟| 91国产成人在线| 日韩在线一二三区| 精品av综合导航| 国产99久久久国产精品潘金网站| 国产精品久久久久三级| 色哟哟欧美精品| 秋霞影院一区二区| 久久精品日产第一区二区三区高清版 | 久久欧美中文字幕| 丰满放荡岳乱妇91ww| 亚洲精品久久久蜜桃| 欧美浪妇xxxx高跟鞋交| 精品亚洲aⅴ乱码一区二区三区| 午夜精品爽啪视频| 久久这里只有精品6| 91丨porny丨蝌蚪视频| 亚洲成a人v欧美综合天堂| 91精品国产综合久久香蕉麻豆| 精品一二线国产| 国产精品国产精品国产专区不片 | 精品久久五月天| 不卡在线观看av| 亚洲第一主播视频| 精品国产1区二区| 91视频免费播放| 麻豆精品视频在线观看| 国产精品国产三级国产| 9191精品国产综合久久久久久| 国产一区二区女| 一区二区三区四区不卡视频| 日韩一级高清毛片| 9i看片成人免费高清| 美美哒免费高清在线观看视频一区二区| 久久精品网站免费观看| 欧美中文字幕一区| 国产精品伊人色| 午夜久久久影院| 中文字幕中文字幕一区| 欧美一区二区视频观看视频| www.99精品| 极品少妇xxxx偷拍精品少妇| 有码一区二区三区| 久久久精品影视| 在线成人高清不卡| 99精品视频在线观看免费| 久久精品av麻豆的观看方式| 亚洲日本va午夜在线电影| 欧美精品一区二区久久久| 欧美日韩一级二级| 成人性视频网站| 男女男精品网站| 亚洲综合精品久久| 国产精品天干天干在线综合| 日韩视频免费直播| 欧美亚洲丝袜传媒另类| 成人激情电影免费在线观看| 麻豆精品一二三| 日韩国产高清在线| 亚洲综合丁香婷婷六月香| 中文字幕不卡在线播放| 精品国产乱码久久久久久蜜臀| 欧美体内she精视频| av在线不卡观看免费观看| 国内不卡的二区三区中文字幕| 婷婷久久综合九色国产成人| 成人美女视频在线观看| 久久99精品国产麻豆不卡| 亚洲不卡av一区二区三区| 亚洲少妇屁股交4| 中文字幕日本不卡| 国产欧美日韩视频在线观看| 日韩欧美国产高清| 91超碰这里只有精品国产| 欧美图区在线视频| 欧美性高清videossexo| 一本大道久久精品懂色aⅴ| hitomi一区二区三区精品| 成人精品国产免费网站| 懂色av一区二区三区免费看| 国产剧情一区二区三区| 国产一区二区在线免费观看| 久久精品国产精品亚洲综合|