资源简介
FP-tree是一个数据库里跟产生频繁集有关的信息的压缩表示。该实现基于Windows平台,编程工具是Visual C++ 6.0,许多地方还用到了C++的标准模板库。另外还附带c#和matlab版本
代码片段和文件信息
/*----------------------------------------------------------------------
File : data.cpp
Contents: data set management
Author : Bart Goethals
Update : 04/04/2003
----------------------------------------------------------------------*/
#include
using namespace std;
#include “data.h“
Transaction::Transaction(const Transaction &tr)
{
length = tr.length;
t = new int[tr.length];
for(int i=0; i< length; i++) t[i] = tr.t[i];
}
Data::Data(char *filename int t)
{
fn = filename;
type = t;
current=0;
if(type>1) in = fopen(fn“rt“);
else in = fopen(fn“rb“);
}
Data::~Data()
{
if(in) fclose(in);
}
Transaction *Data::getNext()
{
Transaction *t=0;
switch(type){
case 1: t= getNextBin(); break;
case 2: t= getNextAs(); break;
case 3: t= getNextAsFlat(); break;
case 4: t= getNextAsQuest(); break;
}
if(t) current++;
else {
rewind(in);
current=0;
}
return t;
}
Transaction *Data::getNextAs()
{
Transaction *t;
int tid item i dummy;
vector list;
static int cur=0prev=-1;
static bool begin=true;
if(feof(in)) {
begin=true;
prev=-1;
return 0;
}
if(!begin) list.push_back(cur);
else begin=false;
while(true) {
fscanf(in “%d %d %d“&dummy &tid &item);
if(feof(in)) {
int size=list.size();
t = new Transaction(size);
for(i=0; it[i] = list[i];
list.clear();
return t;
}
else if(prev<0) prev=tid;
else if(tid != prev){
prev = tid;
cur = item;
int size=list.size();
t = new Transaction(size);
for(i=0; it[i] = list[i];
list.clear();
return t;
}
list.push_back(item);
}
}
Transaction *Data::getNextAsFlat()
{
vector list;
char c;
// read list of items
do {
int item=0 pos=0;
c = getc(in);
while((c >= ‘0‘) && (c <= ‘9‘)) {
item *=10;
item += int(c)-int(‘0‘);
c = getc(in);
pos++;
}
if(pos) list.push_back(item);
}while(c != ‘\n‘ && !feof(in));
// if end of file is reached rewind to beginning for next pass
if(feof(in)){
rewind(in);
return 0;
}
// Note also last transaction must end with newline
// else it will be ignored
// sort list of items
// sort(list.begin()list.end());
// put items in Transaction structure
Transaction *t = new Transaction(list.size());
for(int i=0; i t->t[i] = list[i];
return t;
}
Transaction *Data::getNextAsQuest()
{
int tmptid tidli;
Transaction *t;
fscanf(in“%d %d %d“&tmptid&tid&l);
if(feof(in)) return 0;
t = new Transaction(l);
for(i=0; it[i]);
return t;
}
Transaction *Data::getNextBin()
{
int tmptid tidli;
Transaction *t;
fread(&tmptid4 1in);
if(feof(in)) return 0;
fread(&tid4 1in);
fread(&l4 1in);
t = new Transaction(l);
for(i=0; it[i]4 1in);
return t;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 967746 2018-02-01 09:44 fpgrowth\51CTO下载-FP_Growth.rar
文件 122880 2018-02-01 09:43 fpgrowth\51CTO下载-数据挖掘关联规则FP-growth算法.doc
文件 2994 2003-08-05 06:38 fpgrowth\data.cpp
文件 732 2003-04-04 21:01 fpgrowth\data.h
文件 297 2017-12-27 14:03 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\data.m
文件 29224320 2017-12-28 10:34 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\DATA.txt
文件 2914 2017-12-28 14:17 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\data1.mat
文件 6175 2017-12-27 11:00 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\data2.mat
文件 1172919 2017-12-28 11:21 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\data8.mat
..A.SH. 46 2017-12-13 18:55 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\desktop.ini
文件 743 2015-08-28 22:34 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\DisplayRules.m
文件 5617 2017-12-11 19:23 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\FPGrowth.m
文件 595 2015-08-28 22:34 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\GetNonTrivialSubsets.m
文件 678 2017-12-07 11:11 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\GetPowerSet.m
文件 470 2015-08-28 22:34 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\IsSame.m
文件 1350 2015-08-23 04:39 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\license.txt
文件 762 2017-12-28 14:17 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\main.m
文件 291601 2017-12-28 09:24 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\matlab.mat
文件 1593 2017-12-26 10:14 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\mydata.mat
文件 919 2015-08-28 22:34 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\PlotTree.m
文件 121 2015-08-23 04:35 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\www.yarpiz.com.url
文件 2288 2017-12-04 22:00 fpgrowth\FP-Growth Assiciation Rule Mining(matlab)\新建文本文档.txt
文件 31 2008-07-19 22:45 fpgrowth\FP-TREE(c算法)\a.txt
文件 31 2008-08-13 12:10 fpgrowth\FP-TREE(c算法)\b.txt
文件 167988 2008-08-13 12:10 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.exe
..A.SH. 188336 2008-08-13 12:10 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.ilk
文件 810 2018-02-01 09:45 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.log
文件 620 2018-02-01 09:45 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.tlog\cl.command.1.tlog
文件 4086 2018-02-01 09:45 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.tlog\CL.read.1.tlog
文件 276 2018-02-01 09:45 fpgrowth\FP-TREE(c算法)\Debug\fp-growth.tlog\CL.write.1.tlog
............此处省略49个文件信息
相关资源
- C++Templates简体中文文字版
- C语言实现了crontab表达式执行时间
- gcc-c++-4.4.7-16.el6.x86_64.rpm
- MFC邮件收发器 SMTP POP3
- 嗜睡的理发师进程同步与实现c++
- C++扫雷游戏QT图形界面
- 智能家居的毕业设计论文,c++
- vc++mfc经典数字图像处理程序
- 霍夫找圆,找线的程序
- 钱能C++程序设计教程第二版课后答案
- DX9.0小游戏C++代码
- socket编程聊天室C++
- 基于C++用用CBC与ECB模式的DES加解密
- C++多边形有效边填充算法
- MD5算法C++实现
- 傅里叶变换和傅里叶逆变换的C++代码
- 课程设计---c++代码相似度计算
- C++课件PDF
- C++ MFC实现的字符点阵转换工具
- c++ mfc 校园导航 最短路径计算
- Visual C++程序设计学习笔记光盘源码
- 餐厅管理系统 C++,自己随便做做的,
- 学生信息管理系统C++简单教学版
- 用vs2015编译好的百度ocr c++依赖库
- C++基于MFC与ACCESS数据库的成绩管理系
- C++并发编程第二版,中文版
- 基于Visual C#的DirectX开发.rar
- 抓包源码,有兴趣的拿走
- c++贪吃蛇编程源代码论文设计c语言
- vc++调用usb摄像头,进行拍照,保存为
评论
共有 条评论