资源简介
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个文件信息
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c#与西门子1500通讯
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
评论
共有 条评论