-
大小: 1.88MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-10-14
- 語言: 其他
- 標(biāo)簽: 數(shù)據(jù)挖掘??Apriori??FP-tree??
資源簡介
數(shù)據(jù)挖掘的課程作業(yè)實現(xiàn),兩種算法的實現(xiàn),包括測試數(shù)據(jù),可執(zhí)行程序和源代碼,及兩個算法實現(xiàn)的對比截圖。

代碼片段和文件信息
using?System;
using?System.Collections;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.IO;
namespace?FPTree//?FPTree獲取頻繁模式
{
????public?partial?class?FormFPTree?:?Form
????{
????????static?int?MinSupCount?=?1000;//?最小支持度計數(shù)
????????static?int?MinSupPercent?=?8;//?最小支持度
????????static?int?TotalItems?=?0;//?事務(wù)數(shù)據(jù)庫中的所有事務(wù)總數(shù)
????????static?string?_testSet?=?““;//?測試集的文件名
????????public?FormFPTree()
????????{
????????????InitializeComponent();
????????}
????????private?void?DoAnalysis(string?_dataSetFileName)//?分析數(shù)據(jù)
????????{
????????????//FPTree
????????????FPTree?_fpTree?=?new?FPTree();
????????????//FPTree挖掘
????????????FPGrowthFacade?_fpGrowthFacade?=?new?FPGrowthFacade();????
????????????DateTime?_dateTimeStart?=?DateTime.Now;?
????????????//讀取數(shù)據(jù)集并遍歷取得頻繁一項集
????????????ReadFile(_dataSetFileName?_fpTree);
????????????_fpTree.InitializeFPTree();
??????????
????????????_fpGrowthFacade.FPGrowth(_fpTree?null);
????????????_content.Text?=?““;
????????????if?(_fpGrowthFacade.FrequentPattern.Count?>?0)
????????????{
????????????????DateTime?_dateTimeEnd?=?DateTime.Now;
????????????????TimeSpan?_span?=?(_dateTimeEnd?-?_dateTimeStart);???????????????
????????????????_content.Text?+=?“程序分析總時間:“?+?_span.TotalSeconds.ToString()?+?“\r\n“?+“\r\n\r\n“;??????????????
????????????????foreach?(DictionaryEntry?_entry?in?_fpGrowthFacade.FrequentPattern)
????????????????{
????????????????????List?_tmpItemSetList?=?(List)_fpGrowthFacade.FrequentPattern[_entry.Key];
????????????????????_content.Text?+=?“頻繁“?+?_entry.Key?+?“項集“?+?_tmpItemSetList.Count+?“個\r\n“;
????????????????????
????????????????????foreach?(ItemSet?_itemSet?in?_tmpItemSetList)
????????????????????{
????????????????????????string[]?_contents?=?new?string[_itemSet.Content.Count];
????????????????????????_itemSet.Content.CopyTo(_contents);
????????????????????????_content.Text?+=?ShowInOrder(_fpTree?_contents)?+?“————“?+?_itemSet.Count?+?“\r\n“;
????????????????????}
????????????????}
????????????????_content.Text?+=?“頻繁一項集“?+?_fpTree.FrequentItemCount?+?“個:\r\n“;
????????????????foreach?(DictionaryEntry?_entry?in?_fpTree.HashFrequentItemTable)
????????????????{
????????????????????_content.Text?+=?_entry.Key?+?“————“?+?_entry.Value.ToString()?+?“\r\n“;
????????????????}
????????????}
????????????_fpTree.DisposeAll();
????????????_fpGrowthFacade.DisposeAll();
????????}
????????private?string?ShowInOrder(FPTree?_fpTree?string[]?_contents)//按順序顯示字符
????????{
????????????int[]?_indexs?=?new?int[_contents.Length];
????????????for?(int?i?=?0;?i?????????????{
????????????????_indexs[i]?=?_fpTree.GetSupCountByID(_contents[i]);
????????????}
????????????int?count?=?_indexs.Length;
????????????for?(int?bubble?=?0;?bubble?????????????{
????????????????fo
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????58750??2012-04-12?19:41??0.07.PNG
?????目錄???????????0??2012-04-12?18:46??可執(zhí)行的程序\
?????文件???????24064??2012-04-16?20:35??可執(zhí)行的程序\FPTree.exe
?????文件???????17408??2012-04-12?18:36??可執(zhí)行的程序\MyApriori.exe
?????文件???????53508??2012-04-12?19:20??圖1.PNG
?????目錄???????????0??2012-04-16?21:13??測試數(shù)據(jù)\
?????文件??????345490??2012-04-11?21:20??測試數(shù)據(jù)\chess.dat
?????文件??????????53??2012-03-27?22:29??測試數(shù)據(jù)\chess1.dat
?????文件?????4167490??2012-03-14?12:32??測試數(shù)據(jù)\retail.dat
?????目錄???????????0??2012-09-09?10:58??源代碼\
?????目錄???????????0??2012-04-16?21:10??源代碼\FP__Tree\
?????目錄???????????0??2008-01-06?09:44??源代碼\FP__Tree\FPTree\
?????文件?????????908??2012-04-12?13:08??源代碼\FP__Tree\FPTree.sln
?????文件???????32256??2012-09-09?10:58??源代碼\FP__Tree\FPTree.suo
?????目錄???????????0??2008-01-06?09:44??源代碼\FP__Tree\FPTree\bin\
?????目錄???????????0??2012-04-16?20:23??源代碼\FP__Tree\FPTree\bin\Debug\
?????文件???????24064??2012-04-16?20:35??源代碼\FP__Tree\FPTree\bin\Debug\FPTree.exe
?????文件???????83456??2012-04-16?20:35??源代碼\FP__Tree\FPTree\bin\Debug\FPTree.pdb
?????文件???????11608??2012-09-09?10:58??源代碼\FP__Tree\FPTree\bin\Debug\FPTree.vshost.exe
?????文件?????????490??2010-03-18?14:39??源代碼\FP__Tree\FPTree\bin\Debug\FPTree.vshost.exe.manifest
?????文件????????8110??2012-04-16?21:09??源代碼\FP__Tree\FPTree\FormFPTree.cs
?????文件????????6636??2012-04-16?21:09??源代碼\FP__Tree\FPTree\FormFPTree.Designer.cs
?????文件????????6191??2012-04-16?21:09??源代碼\FP__Tree\FPTree\FormFPTree.resx
?????文件???????11435??2012-04-16?21:01??源代碼\FP__Tree\FPTree\FPGrowthFacade.cs
?????文件???????14532??2012-04-16?21:04??源代碼\FP__Tree\FPTree\FPTree.cs
?????文件????????3980??2012-04-12?13:08??源代碼\FP__Tree\FPTree\FPTree.csproj
?????文件?????????374??2012-04-12?13:08??源代碼\FP__Tree\FPTree\FPTree.csproj.user
?????文件????????1276??2008-01-02?19:50??源代碼\FP__Tree\FPTree\FrequentItem.cs
?????文件?????????661??2012-04-16?21:05??源代碼\FP__Tree\FPTree\Frequentli
?????文件?????????779??2012-04-16?21:05??源代碼\FP__Tree\FPTree\ItemInfo.cs
?????文件????????1053??2012-04-16?21:06??源代碼\FP__Tree\FPTree\ItemSet.cs
............此處省略68個文件信息
- 上一篇:貴州茅臺的DCF估值
- 下一篇:經(jīng)典紋理圖像分割論文+代碼
評論
共有 條評論