设为首页 加入收藏

TOP

数据挖掘基础:在数据中寻找相关的项目Apriori算法
2015-11-21 01:51:08 来源: 作者: 【 】 浏览:0
Tags:数据挖掘 基础 数据 寻找 相关 项目 Apriori 算法
Ck: Candidate itemset of size k
Lk : frequent itemset of size k


L1 = {frequent items};
for (k = 1; Lk !=?; k++) do begin
    Ck+1 = candidates generated from Lk;
    for each transaction t in database do
  increment the count of all candidates in Ck+1 that are contained in t
    Lk+1  = candidates in Ck+1 with min_support
    end
return ?k Lk;
 
 

SQL应用

Suppose the items in Lk-1 are listed in an order
Step 1: self-joining Lk-1 
insert into Ck
select p.item1, p.item2, …, p.itemk-1, q.itemk-1
from Lk-1 p, Lk-1 q
where p.item1=q.item1, …, p.itemk-2=q.itemk-2, p.itemk-1 < q.itemk-1
Step 2: pruning
forall itemsets c in Ck do
forall (k-1)-subsets s of c do
if (s is not in Lk-1) then delete c from Ck


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MongoDB Helper的简单封装 下一篇数据库 'tempdb' 的日志..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: