码迷,mamicode.com
首页 > 编程语言 > 详细

数据挖掘基础:在数据中寻找相关的项目 Apriori算法

时间:2015-04-15 17:04:21      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:数据挖掘   数据   database   算法   sql   

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


数据挖掘基础:在数据中寻找相关的项目 Apriori算法

标签:数据挖掘   数据   database   算法   sql   

原文地址:http://blog.csdn.net/qq_21970857/article/details/45061513

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!