Upload
dien-tuan-le
View
224
Download
0
Embed Size (px)
Citation preview
8/2/2019 Closet Algorithms
1/10
8/2/2019 Closet Algorithms
2/10
8/2/2019 Closet Algorithms
3/10
8/2/2019 Closet Algorithms
4/10
o r d e r o f f l i s t a n d a n y i n f r e q u e n t i t e m , s u c h a s b
i s o m i t t e d . F o r e x a m p l e , a b e i s l i s t e d a s e a
2 D i v i d e s e a r c h s p a c e . A l l t h e f r e q u e n t c l o s e d
i t e m s e t s c a n b e d i v i d e d i n t o 5 n o n - o v e r l a p s u b s e t s
b a s e d o n t h e f l i s t : ( 1 ) t h e o n e s c o n t a i n i n g i t e m
d , ( 2 ) t h e o n e s c o n t a i n i n g i t e m a b u t n o d , ( 3 ) t h e
o n e s c o n t a i n i n g i t e m f b u t n o a n o r d , ( 4 ) t h e o n e s
c o n t a i n i n g e b u t n o f a n o r d , a n d ( 5 ) t h e o n e
c o n t a i n i n g o n l y c . O n c e a l l s u b s e t s a r e f o u n d , t h e
c o m p l e t e s e t o f f r e q u e n t c l o s e d i t e m s e t s i s d o n e .
3 F i n d s u b s e t s o f f r e q u e n t c l o s e d i t e m s e t s . T h e s u b -
s e t s o f f r e q u e n t c l o s e d i t e m s e t s c a n b e m i n e d b y
c o n s t r u c t i n g c o r r e s p o n d i n g c o n d i t i o n a l d a t a b a s e s
a n d m i n e e a c h r e c u r s i v e l y .
( a ) F i n d f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g d . O n l y
t r a n s a c t i o n s c o n t a i n i n g d a r e n e e d e d . T h e d -
c o n d i t i o n a l d a t a b a s e , d e n o t e d a s T D B
d
, c o n -
t a i n s a l l t h e t r a n s a c t i o n s h a v i n g d , w h i c h i s
f c e f a c f a g . N o t i c e t h a t i t e m d i s o m i t t e d i n
e a c h t r a n s a c t i o n s i n c e i t a p p e a r s i n e v e r y t r a n s -
a c t i o n i n t h e d - c o n d i t i o n a l d a t a b a s e .
T h e s u p p o r t o f d i s 2 . I t e m s c f , a n d a
a p p e a r t w i c e r e s p e c t i v e l y i n T D B
d
. T h a t i s ,
e v e r y t r a n s a c t i o n c o n t a i n i n g d a l s o c o n t a i n s
c f , a n d a . M o r e o v e r , e i s i n f r e q u e n t s i n c e
i t a p p e a r s o n l y o n c e i n T D B
d
. T h e r e f o r e ,
c f a d : 2 i s a f r e q u e n t c l o s e d i t e m s e t . S i n c e t h i s
i t e m s e t c o v e r s e v e r y f r e q u e n t i t e m i n T D B
d
t h e m i n i n g o f T D B
d
n i s h e s .
( b ) F i n d f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g a b u t
n o d . S i m i l a r l y , t h e a - c o n d i t i o n a l d a t a b a s e
T D B
a
= f c e f ; e ; c f g . I t e m d i n s u c h t r a n s a c -
t i o n s a r e o m i t t e d , s i n c e a l l f r e q u e n t c l o s e d i t e m -
s e t s c o n t a i n i n g d h a v e b e e n f o u n d i n T D B
d
S i n c e s u p ( a ) = 3 a n d t h e r e i s n o a n y i t e m a p -
p e a r i n g i n e v e r y t r a n s a c t i o n s i n t h e a - c o n d i t i o n a l
d a t a b a s e , a : 3 i s a f r e q u e n t c l o s e d i t e m s e t .
T o n d t h e r e m a i n i n g f r e q u e n t c l o s e d i t e m s e t s
c o n t a i n i n g a b u t n o d , w e n e e d t o f u r t h e r
p r o j e c t t h e a - c o n d i t i o n a l d a t a b a s e . F i r s t ,
t h e s e t o f f r e q u e n t i t e m s i n t h e a - c o n d i t i o n a l
d a t a b a s e f o r m s a l o c a l f r e q u e n t i t e m l i s t f l i s t
a
= h c 2 e 2 f 2 i
3
. L o c a l i n f r e q u e n t i t e m i s
i g n o r e d e v e n i f i t i s i n g l o b a l f l i s t
A c c o r d i n g t o f l i s t
a
, t h e f r e q u e n t c l o s e d i t e m s e t s
c o n t a i n i n g a b u t n o d c a n b e f u r t h e r p a r t i t i o n e d
i n t o t h r e e s u b s e t s : ( 1 ) t h e o n e s c o n t a i n i n g a f
b u t n o d , ( 2 ) t h e o n e s c o n t a i n i n g a e b u t n o t
d o r f , a n d ( 3 ) t h e o n e s c o n t a i n i n g a c b u t n o
3
I n t h i s e x a m p l e , i t h a p p e n s f l i s t
a
i s a p r e x o f ( g l o b a l )
f l i s t , w i t h d i e r e n t c o u n t s . I n g e n e r a l , t h e l o c a l f r e q u e n t i t e m s
c a n b e r e - a r r a n g e d a c c o r d i n g t o t h e l o c a l s u p p o r t c o u n t s .
d e o r f . T h e y c a n b e m i n e d b y c o n s t r u c t i n g
c o n d i t i o n a l d a t a b a s e s r e c u r s i v e l y .
T h e s u p p o r t o f f a e q u a l s t o t h a t o f c f a d
w h i c h i s a s u p e r s e t o f f a a n d a l s o a f r e q u e n t
c l o s e d i t e m s e t a l r e a d y f o u n d . T h a t m e a n s e v e r y
t r a n s a c t i o n c o n t a i n i n g f a m u s t a l s o c o n t a i n
c f a d . T h e r e f o r e , t h e r e i s n o f r e q u e n t c l o s e d
i t e m s e t c o n t a i n i n g f a b u t n o d . S i m i l a r l y , t h e r e
i s n o f r e q u e n t c l o s e d i t e m s e t c o n t a i n i n g c a b u t
n o t d e o r f , s i n c e c a i s a s u b s e t o f c f a d a n d
s u p ( c a ) = s u p ( c f a d )
T h e e a - c o n d i t i o n a l d a t a b a s e , T D B
e
a = f c g
c a n n o t g e n e r a t e a n y f r e q u e n t i t e m s . T h u s ,
e a : 2 s h o u l d b e a f r e q u e n t c l o s e d i t e m s e t .
( c ) F i n d f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g f b u t n o
a n o r d . T h e f - c o n d i t i o n a l d a t a b a s e T D B
f
=
f c e 3 c g , w h e r e c e : 3 i n d i c a t e s t h a t c e
h a p p e n s t h r e e t i m e s . S i n c e c h a p p e n s i n e v e r y
t r a n s a c t i o n i n t h e f - c o n d i t i o n a l d a t a b a s e , a n d
c f i s n o t a s u b s e t o f a n y f r e q u e n t c l o s e d i t e m s e t
w i t h t h e s a m e s u p p o r t , c f : 4 i s a f r e q u e n t
c l o s e d i t e m s e t . S i n c e t h e s u p p o r t o f f c a l s o
e q u a l s t o t h o s e o f f a n d c f a n d c a l w a y s
h a p p e n t o g e t h e r , s o t h e r e i s n o f r e q u e n t c l o s e d
i t e m s e t s c o n t a i n i n g c b u t n o f . A l s o , t h a t
c e f : 3 i s n o t a s u b s e t o f a n y i t e m s e t f o u n d ,
s o i t i s a f r e q u e n t c l o s e d i t e m s e t .
( d ) F i n d f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g e b u t n o
f a n o r d . S i m i l a r l y , t h e e - c o n d i t i o n a l d a t a b a s e
T D B
e
= f c 3 g . B u t c e i s n o t a c l o s e d
i t e m s e t s i n c e i t i s a p r o p e r s u b s e t o f c e f a n d
s u p ( c e ) = s u p ( c e f ) . H o w e v e r , e : 4 i s a f r e q u e n t
c l o s e d i t e m s e t s .
( e ) F i n d f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g o n l y c
I n S t e p 3 c , w e k n o w t h a t t h e r e i s n o f r e q u e n t
c l o s e d i t e m s e t s c o n t a i n i n g c b u t n o f , s o t h e r e
i s n o f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g o n l y c
4 . I n s u m m a r y , t h e s e t o f f r e q u e n t c l o s e d i t e m s e t s
f o u n d i s f a c d f 2 a 3 a e 2 c f 4 c e f 3
e 4 g 2
3 2 C L O S E T : A l g o r i t h m a n d S o u n d n e s s
N o w , l e t u s j u s t i f y t h e c o r r e c t n e s s a n d c o m p l e t e n e s s
o f t h e m i n i n g p r o c e s s i n E x a m p l e 2 .
D e n i t i o n 3 ( F r e q u e n t i t e m l i s t , f l i s t ) G i v e n a
t r a n s a c t i o n d a t a b a s e T D B a n d a s u p p o r t t h r e s h o l d
m i n s u p , t h e l i s t o f a l l f r e q u e n t i t e m s i n s u p p o r t
d e s c e n d i n g o r d e r i s c a l l e d t h e f r e q u e n t i t e m l i s t
o r f l i s t i n s h o r t . 2
L e m m a 3 . 1 G i v e n a t r a n s a c t i o n d a t a b a s e T D B a
s u p p o r t t h r e s h o l d m i n s u p , a n d f l i s t = h i
1
i
2
; : : : ; i
n
i
8/2/2019 Closet Algorithms
5/10
t h e p r o b l e m o f m i n i n g t h e c o m p l e t e s e t o f f r e q u e n t
c l o s e d i t e m s e t s c a n b e d i v i d e d i n t o n s u b - p r o b l e m s :
T h e j
t h
p r o b l e m ( 1 j n ) i s t o n d t h e c o m p l e t e
s e t o f f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g i
n + 1 j
b u t
n o i
k
( f o r n + 1 ? j < k n ) 2
T h e p r o b l e m p a r t i t i o n i n g c a n b e p e r f o r m e d r e c u r -
s i v e l y . T h a t i s , e a c h s u b s e t o f f r e q u e n t c l o s e d i t e m s e t s
c a n b e f u r t h e r d i v i d e d w h e n n e c e s s a r y . T h i s f o r m s a
d i v i d e - a n d - c o n q u e r f r a m e w o r k . T o m i n e t h e s u b s e t s
o f f r e q u e n t c l o s e d i t e m s e t s , w e c o n s t r u c t c o r r e s p o n d -
i n g c o n d i t i o n a l d a t a b a s e s .
D e n i t i o n 4 ( C o n d i t i o n a l d a t a b a s e ) G i v e n a
t r a n s a c t i o n d a t a b a s e T D B . L e t i b e a f r e q u e n t i t e m
i n T D B . T h e i - c o n d i t i o n a l d a t a b a s e , d e n o t e d
a s T D B
i
, i s t h e s u b s e t o f t r a n s a c t i o n s i n T D B
c o n t a i n i n g i , a n d a l l t h e o c c u r r e n c e s o f i n f r e q u e n t
i t e m s , i t e m i , a n d i t e m s f o l l o w i n g i i n t h e f l i s t a r e
o m i t t e d .
L e t j b e a f r e q u e n t i t e m i n X - c o n d i t i o n a l d a t a b a s e
T D B
X
, w h e r e X i s a f r e q u e n t i t e m s e t . T h e j X -
c o n d i t i o n a l d a t a b a s e , d e n o t e d a s T D B
j X
, i s t h e
s u b s e t o f t r a n s a c t i o n s i n T D B
X
c o n t a i n i n g j a n d a l l
t h e o c c u r r e n c e s o f l o c a l i n f r e q u e n t i t e m s , i t e m j , a n d
i t e m s f o l l o w i n g j i n l o c a l f l i s t
X
a r e o m i t t e d . 2
T o n d t h e f r e q u e n t c l o s e d i t e m s e t s c o n t a i n i n g i
b u t n o o t h e r i t e m s f o l l o w i n g i i n f l i s t , w e c o n s t r u c t
t h e i - c o n d i t i o n a l d a t a b a s e . T h e n t h e s u b p r o b l e m
c a n b e d i v i d e d f u r t h e r i f n e c e s s a r y . F o r i n s t a n c e ,
i n E x a m p l e 2 , w e f u r t h e r c o n s t r u c t t h e f a - a n d
e a - c o n d i t i o n a l d a t a b a s e s b a s e d o n t h e a - c o n d i t i o n a l
d a t a b a s e .
H o w c a n w e i d e n t i f y t h e f r e q u e n t c l o s e d i t e m s e t s
f r o m c o n d i t i o n a l d a t a b a s e s ? T h e f o l l o w i n g l e m m a
p r o v i d e s t h e t h e o r e t i c a l f o u n d a t i o n t h a t C L O S E T c a n
n d f r e q u e n t c l o s e d i t e m s e t s c o r r e c t l y .
L e m m a 3 . 2 I f X i s a f r e q u e n t c l o s e d i t e m s e t , t h e n
t h e r e i s n o i t e m a p p e a r i n g i n e v e r y t r a n s a c t i o n i n t h e
X - c o n d i t i o n a l d a t a b a s e .
P r o o f . I f t h e r e e x i s t s a n i t e m i a p p e a r i n g i n e v e r y
t r a n s a c t i o n i n t h e X - c o n d i t i o n a l d a t a b a s e , w e h a v e
s u p ( i X ) = s u p ( X ) . F o l l o w i n g L e m m a 2 . 1 , X c a n n o t
b e a c l o s e d i t e m s e t . T h u s , w e h a v e t h e l e m m a . 2
L e m m a 3 . 3 I f a n i t e m s e t Y i s t h e m a x i m a l s e t
o f i t e m s a p p e a r i n g i n e v e r y t r a n s a c t i o n i n t h e X -
c o n d i t i o n a l d a t a b a s e , a n d X Y i s n o t s u b s u m e d
b y s o m e a l r e a d y f o u n d f r e q u e n t c l o s e d i t e m s e t w i t h
i d e n t i c a l s u p p o r t , t h e n X Y i s a f r e q u e n t c l o s e d
i t e m s e t .
P r o o f . I f a n i t e m s e t Y i s t h e m a x i m a l s e t o f i t e m s
a p p e a r i n g i n e v e r y t r a n s a c t i o n i n t h e X - c o n d i t i o n a l
d a t a b a s e , X Y i s p o t e n t i a l l y a f r e q u e n t c l o s e d
i t e m s e t . T h e c r u c i a l p o i n t b e c o m e s w h e t h e r l a t e r
g e n e r a t e d f r e q u e n t c l o s e d i t e m s e t m a y s u b s u m e i t .
S u p p o s e t h e r e e x i s t s a f r e q u e n t c l o s e d i t e m s e t X
Y Z w h i c h s u b s u m e s X Y , i . e . , b e i n g f r e q u e n t
a n d h a v i n g i d e n t i c a l s u p p o r t k Z w i l l o c c u r t o g e t h e r
w i t h X a t l e a s t k t i m e s a n d s h o u l d b e e i t h e r i n X ' s
c o n d i t i o n a l d a t a b a s e o r e a r l i e r , b a s e d o n t h e r u l e s o f
c o n s t r u c t i o n c o n d i t i o n a l d a t a b a s e s . T h u s i t c a n n o t
a p p e a r l a t e r . T h u s , w e h a v e t h e l e m m a . 2
T h e s e a r c h f o r c l o s e d i t e m s e t s c a n b e i m p r o v e d
f u r t h e r b y a f e w o p t i m i z a t i o n t e c h n i q u e s a s s h o w n
b e l o w .
O p t i m i z a t i o n 1 : C o m p r e s s t r a n s a c t i o n a l a n d
c o n d i t i o n a l d a t a b a s e s u s i n g a n F P - t r e e s t r u c t u r e .
A n F P - t r e e 6 ] i s a p r e x t r e e s t r u c t u r e , r e p r e s e n t -
i n g c o m p r e s s e d b u t c o m p l e t e f r e q u e n t i t e m s e t i n -
f o r m a t i o n f o r a d a t a b a s e . I t s c o n s t r u c t i o n i s s i m -
p l e . T h e t r a n s a c t i o n s w i t h t h e s a m e p r e x s h a r e
t h e p o r t i o n o f a p a t h f r o m t h e r o o t . S i m i l a r l y , c o n -
d i t i o n a l F P - t r e e s c a n b e c o n s t r u c t e d f o r c o n d i t i o n a l
d a t a b a s e s . W e r e f e r r e a d e r s t o 6 ] f o r d e t a i l s a b o u t
t h e F P - t r e e a n d t h e r e l a t e d t e c h n i q u e s . T h e r e a r e
t h e f o l l o w i n g b e n e t s f o r u s i n g F P - t r e e i n t h e c l o s e d
i t e m s e t s c o m p u t a t i o n .
F P - t r e e c o m p r e s s e s d a t a b a s e s f o r f r e q u e n t i t m s e t
m i n i n g . T r a n s a c t i o n s s h a r i n g c o m m o n p r e x
p a t h s o f a b r a n c h o f t h e t r e e w i l l n o t c r e a t e a n y
n e w n o d e s i n a n F P - t r e e . M o r e o v e r , t h e d e e p e r
t h e r e c u r s i o n i n t h e c o n s t r u c t i o n o f c o n d i t i o n a l
d a t a b a s e s , t h e b e t t e r c h a n c e o f s h a r i n g , a n d t h e
m o r e c o m p a c t t h e c o n d i t i o n a l F P - t r e e
C o n d i t i o n a l d a t a b a s e s c a n b e d e r i v e d f r o m F P - t r e e
e c i e n t l y . T h i s i s s h o w n i n 6 ] . S i n c e F P - t r e e m a y
c o m p r e s s m u l t i p l e t r a n s a c t i o n s i n t o o n e p a t h , t h e
p r o j e c t i o n o f t h i s p a t h i s e q u i v a l e n t t o t h e s c a n o f
m u l t i p l e t r a n s a c t i o n s .
O p t i m i z a t i o n 2 : E x t r a c t i t e m s a p p e a r i n g i n
e v e r y t r a n s a c t i o n o f c o n d i t i o n a l d a t a b a s e .
I f t h e r e e x i s t s a s e t o f i t e m s Y a p p e a r i n g i n e v e r y
t r a n s a c t i o n o f t h e X - c o n d i t i o n a l d a t a b a s e , X Y
f o r m s a f r e q u e n t c l o s e d i t e m s e t i f i t i s n o t a p r o p e r
s u b s e t o f s o m e f r e q u e n t c l o s e d i t e m s e t w i t h t h e s a m e
s u p p o r t . F o r i n s t a n c e , i n E x a m p l e 2 , s i n c e c f , a n d
a a p p e a r i n e v e r y t r a n s a c t i o n i n t h e d - c o n d i t i o n a l
d a t a b a s e , c f a d s h o u l d b e a f r e q u e n t c l o s e d i t e m s e t .
N o t e s i n c e s u c h i t e m s c a n b e e a s i l y i d e n t i e d a t
t h e i t e m c o u n t i n g p h a s e , s u c h a n o p t i m i z a t i o n t a k e s
e e c t e v e n b e f o r e c o n s t r u c t i n g t h e F P - t r e e f o r t h e
8/2/2019 Closet Algorithms
6/10
i_1:n_1
.
.
.
.
.
.
.
.
.
root
i_k1:n_1
i_{k1+1}:n_2
i_k2:n_2
i_kl:n_l
. . . . . .
frequent closed itemset
i_1 ... i_k1:n_1
frequent closed itemset
i_1 ... i_k2:n_2
frequent closed itemset
i_1 ... i_kl:n_l
F i g u r e 2 : D i r e c t l y e x t r a c t f r e q u e n t c l o s e d i t e m s e t s
f r o m F P - t r e e
c o n d i t i o n a l d a t a b a s e . T h e i t e m s e x t r a c t e d s h o u l d
b e e x c l u d e d f r o m t h e l o c a l f r e q u e n t i t e m l i s t a n d
t h e c o n d i t i o n a l d a t a b a s e . T h e s o u n d n e s s o f t h e
o p t i m i z a t i o n f o l l o w s L e m m a 3 . 3 .
O p t i m i z a t i o n 2 t a k e s e e c t w h e n f o r m i n g t h e c o n -
d i t i o n a l d a t a b a s e . I t h a s t h e f o l l o w i n g b e n e t s : ( 1 )
i t r e d u c e s t h e s i z e o f F P - t r e e b e c a u s e t h e c o n d i t i o n a l
d a t a b a s e c o n t a i n s l e s s n u m b e r o f i t e m s a f t e r s u c h e x -
t r a c t i o n , a n d ( 2 ) i t m a y r e d u c e t h e l e v e l o f r e c u r s i o n s
s i n c e i t c o m b i n e s a f e w i t e m s i n t o o n e .
O p t i m i z a t i o n 3 : D i r e c t l y e x t r a c t f r e q u e n t
c l o s e d i t e m s e t s f r o m F P - t r e e
I f t h e r e e x i s t s a s i n g l e p r e x p a t h i n a n F P - t r e e
s o m e f r e q u e n t c l o s e d i t e m s e t s c a n b e e x t r a c t e d d i -
r e c t l y f r o m t h e c o n d i t i o n a l d a t a b a s e . F o r e x a m p l e ,
t h e f - c o n d i t i o n a l d a t a b a s e i n E x a m p l e 2 h a s t r a n s -
a c t i o n s c e : 3 a n d c : 1 . I t s c o r r e s p o n d i n g F P - t r e e h a s
o n l y o n e b r a n c h : h c 4 e 3 i . I n t h i s c a s e , o n e c a n
d i r e c t l y e n u m e r a t e i t e m s e t s c f : 4 a n d c e f : 3 . L e t
u s e x a m i n e t h i s i n m o r e d e t a i l .
D e n i t i o n 5 L e t i b e a f r e q u e n t i t e m i n t h e X -
c o n d i t i o n a l d a t a b a s e . I f t h e r e i s o n l y o n e n o d e N
l a b e l e d i i n t h e c o r r e s p o n d i n g F P - t r e e , e v e r y a n c e s t o r
o f N h a s o n l y o n e c h i l d , a n d N h a s ( 1 ) n o c h i l d , ( 2 )
m o r e t h a n o n e c h i l d , o r ( 3 ) o n e c h i l d w i t h c o u n t v a l u e
s m a l l e r t h a n t h a t o f N , t h e n t h e i - s i n g l e s e g m e n t
i t e m s e t i s t h e u n i o n o f i t e m s e t X a n d t h e s e t o f i t e m s
i n c l u d i n g N a n d N ' s a n c e s t o r s ( e x c l u d i n g t h e r o o t ) .
2
L e m m a 3 . 4 T h e i - s i n g l e s e g m e n t i t e m s e t Y i s a
f r e q u e n t c l o s e d i t e m s e t i f t h e s u p p o r t o f i w i t h i n t h e
c o n d i t i o n a l d a t a b a s e p a s s e s t h e g i v e n t h r e s h o l d a n d Y
i s n o t a p r o p e r s u b s e t o f a n y f r e q u e n t c l o s e d i t e m s e t
a l r e a d y f o u n d .
P r o o f I n F P - t r e e , t h e c o u n t o f N ' s e v e r y a n c e s t o r
i s n o l e s s t h a n t h a t o f N . S i n c e t h e s u p p o r t o f i
w i t h i n t h e c o n d i t i o n a l d a t a b a s e p a s s e s t h e s u p p o r t
t h r e s h o l d , Y i s a f r e q u e n t i t e m s e t . N o w w e s h o w Y i s
c l o s e d . S u p p o s e t h e r e i s a n i t e m j a p p e a r i n g i n e v e r y
t r a n s a c t i o n c o n t a i n i n g Y b u t j 62 Y . T h e s u p p o r t o f j
i n t h e c o n d i t i o n a l d a t a b a s e m u s t b e e q u a l t o t h a t o f i
S i n c e j 62 Y j m u s t f o l l o w i i n t h e l o c a l f r e q u e n t i t e m
l i s t a n d a l l i t e m b e t w e e n i a n d j ( i n c l u d i n g i a n d j )
h a v e t h e s a m e s u p p o r t , i . e . , t h e y a l s o a p p e a r i n e v e r y
t r a n s a c t i o n i n t h e c o n d i t i o n a l d a t a b a s e . A c c o r d i n g
t o t h e c o n s t r u c t i o n o f F P - t r e e i s h o u l d h a v e o n l y o n e
s o n n o d e , w h i c h i s l a b e l e d b y t h e i t e m f o l l o w i n g i
i n t h e l o c a l f r e q u e n t i t e m l i s t , a n d t h e c o u n t o f t h a t
n o d e i s e x a c t l y t h e s a m e a s t h a t o f i . T h a t l e a d s t o a
c o n i c t w i t h Y i s t h e i - s i n g l e s e g m e n t i t e m s e t . T h u s ,
w e h a v e t h e l e m m a . 2
O p t i m i z a t i o n 3 s h a r e s s i m i l a r b e n e t s a s O p t i m i z a -
t i o n 2 . I t a l l o w s t h e p r o g r a m t o i d e n t i f y f r e q u e n t
c l o s e d i t e m s e t s q u i c k l y , r e d u c e s t h e s i z e o f t h e r e m a i n -
i n g F P - t r e e t o b e e x a m i n e d , a n d r e d u c e s t h e l e v e l o f
r e c u r s i o n s s i n c e i t c o m b i n e s m u l t i p l e i t e m s i n t o o n e .
O p t i m i z a t i o n 4 : P r u n e s e a r c h b r a n c h e s .
L e t X a n d Y b e t w o f r e q u e n t i t e m s e t s w i t h t h e
s a m e s u p p o r t . I f X Y , a n d Y i s a c l o s e d
i t e m s e t , t h e n t h e r e i s n o n e e d t o s e a r c h t h e X -
c o n d i t i o n a l d a t a b a s e b e c a u s e t h e r e i s n o h o p e t o
g e n e r a t e f r e q u e n t c l o s e d i t e m s e t f r o m t h e r e . F o r
e x a m p l e , i n E x a m p l e 2 , w e d o n o t n e e d t o s e a r c h t h e
c - c o n d i t i o n a l d a t a b a s e , s i n c e c i s a s u b s e t o f f c , w h i c h
i s a f r e q u e n t c l o s e d i t e m s e t w i t h t h e s a m e s u p p o r t .
T h e s o u n d n e s s o f t h e o p t i m i z a t i o n i s v e r i e d i n t h e
f o l l o w i n g l e m m a .
L e m m a 3 . 5 L e t X a n d Y b e t w o f r e q u e n t i t e m s e t s
w i t h t h e s a m e s u p p o r t . I f X Y , a n d Y i s c l o s e d ,
t h e n t h e r e e x i s t s n o f r e q u e n t c l o s e d i t e m s e t c o n t a i n i n g
X b u t n o t Y ? X
P r o o f . L e t Z b e a f r e q u e n t c l o s e d i t e m s e t c o n t a i n i n g
X . S u p p o s e Z d o e s n o t c o n t a i n s o m e i t e m i 2 Y ? X
S i n c e X Y , a c c o r d i n g t o t h e A - p r i o r i h e u r i s t i c ,
s u p ( X ) ( Y ) s u p ( X ) = s u p ( Y ) h o l d s o n l y i f
f o r e v e r y t r a n s a c t i o n c o n t a i n i n g X , i t a l s o c o n t a i n s
Y ? X . S o i t e m i m u s t a p p e a r i n e v e r y t r a n s a c t i o n
c o n t a i n i n g Z , s i n c e X Z . T h a t m e a n s Z i s n o t
c l o s e d . S o w e h a v e t h e l e m m a . 2
8/2/2019 Closet Algorithms
7/10
B a s e d o n t h e a b o v e r e a s o n i n g a n d a n a l y s i s , w e h a v e
t h e a l g o r i t h m o f C L O S E T a s f o l l o w s .
A l g o r i t h m 1 ( C L O S E T ) : M i n i n g f r e q u e n t c l o s e d
i t e m s e t s b y t h e F P - t r e e m e t h o d .
I n p u t : T r a n s a c t i o n d a t a b a s e T D B a n d s u p p o r t t h r e s h -
o l d m i n s u p
O u t p u t : T h e c o m p l e t e s e t o f f r e q u e n t c l o s e d i t e m -
s e t s ;
M e t h o d :
1 I n i t i a l i z a t i o n . L e t F C I b e t h e s e t o f f r e q u e n t
c l o s e d i t e m s e t . I n i t i a l i z e F C I ? ;
2 F i n d f r e q u e n t i t e m s . S c a n t r a n s a c t i o n d a t a b a s e
T D B , c o m p u t e f r e q u e n t i t e m l i s t f l i s t
3 M i n e f r e q u e n t c l o s e d i t e m s e t s r e c u r s i v e l y . C a l l
C L O S E T ( ; ; T D B ; f l i s t ; F C I )
S u b r o u t i n e C L O S E T ( X ; D B ; f l i s t ; F C I )
P a r a m e t e r s :
X : t h e f r e q u e n t i t e m s e t i f D B i s a n X - c o n d i t i o n a l
d a t a b a s e , o r ; i f D B i s T D B
D B : t r a n s a c t i o n d a t a b a s e o f c o n d i t i o n a l d a t a b a s e ;
f l i s t : f r e q u e n t i t e m l i s t o f D B
F C I : T h e s e t o f f r e q u e n t c l o s e d i t e m s e t s a l r e a d y
f o u n d .
M e t h o d :
1 . L e t Y b e t h e s e t o f i t e m s i n f l i s t s u c h t h a t
t h e y a p p e a r i n e v e r y t r a n s a c t i o n o f D B , i n s e r t
X Y t o F C I i f i t i s n o t a p r o p e r s u b s e t o f
s o m e i t e m s e t i n F C I w i t h t h e s a m e s u p p o r t ; / /
A p p l y i n g O p t i m i z a t i o n 2
2 . B u i l d F P - t r e e f o r D B , i t e m s a l r e a d y b e e x t r a c t e d
s h o u l d b e e x c l u d e d ; / / A p p l y i n g O p t i m i z a t i o n 1
3 . A p p l y O p t i m i z a t i o n 3 t o e x t r a c t f r e q u e n t c l o s e d
i t e m s e t s i f i t i s p o s s i b l e ;
4 . F o r m c o n d i t i o n a l d a t a b a s e f o r e v e r y r e m a i n i n g
i t e m i n f l i s t , a t t h e s a m e t i m e , c o m p u t e l o c a l
f r e q u e n t i t e m l i s t s f o r t h e s e c o n d i t i o n a l d a t a b a s e s ;
5 . F o r e a c h r e m a i n i n g i t e m i i n f l i s t , s t a r t i n g f r o m
t h e l a s t o n e , c a l l C L O S E T ( i X ; D B
i
f l i s t
i
; F C I )
i f i X i s n o t a s u b s e t o f a n y f r e q u e n t c l o s e d i t e m s e t
a l r e a d y f o u n d w i t h t h e s a m e s u p p o r t c o u n t , w h e r e
D B
i
i s t h e i - c o n d i t i o n a l d a t a b a s e w i t h r e s p e c t t o
D B a n d f l i s t
i
i s t h e c o r r e s p o n d i n g f r e q u e n t i t e m
l i s t . / / A p p l y i n g O p t i m i z a t i o n 4 2
L e m m a 3 . 6 A n i t e m s e t i s a f r e q u e n t c l o s e d i t e m s e t
i C L O S E T s a y s s o .
P r o o f . A n i t e m s e t X i s i d e n t i e d a s a f r e q u e n t
c l o s e d i t e m s e t b y C L O S E T w h e n ( 1 ) X i s f r e q u e n t ,
( 2 ) t h e r e i s n o i t e m a p p e a r i n g i n e v e r y t r a n s a c t i o n
i n X - c o n d i t i o n a l d a t a b a s e , a n d ( 3 ) X i s n o t a p r o p e r
s u b s e t o f a n y f r e q u e n t c l o s e d i t e m s e t a l r e a d y f o u n d .
T o h a v e t h e l e m m a , w e s h o w t h a t t h e r e i s n o f r e q u e n t
c l o s e d i t e m s e t Y w h i c h c a n b e f o u n d l a t e r s u c h t h a t
X Y . S u p p o s e w e c a n n d s u c h a n i t e m s e t Y
T h e n ( Y ? X ) 6= ; m u s t h a p p e n i n e v e r y t r a n s a c t i o n
o f t h e X - c o n d i t i o n a l d a t a b a s e . T h a t l e a d s t o a
c o n i c t w i t h t h e f a c t t h a t t h e r e i s n o i t e m a p p e a r i n g
i n e v e r y t r a n s a c t i o n i n t h e X - c o n d i t i o n a l d a t a b a s e .
T h u s , w e h a v e t h e l e m m a . 2
T h e c o r r e c t n e s s o f t h e a l g o r i t h m h a s b e e n r e a s o n e d
s t e p - b y - s t e p i n t h i s s e c t i o n . I t g e n e r a t e s t h e c o m p l e t e
s e t o f f r e q u e n t c l o s e d i t e m s e t s , a s s h o w n i n L e m m a
3 . 6 . T h e f o u r o p t i m i z a t i o n t e c h n i q u e s w o r k w i t h
t h e d i v i d e - a n d - c o n q u e r m e t h o d t o e n s u r e t h a t t h e
f r e q u e n t c l o s e d i t e m s e t s c a n b e e x t r a c t e d e c i e n t l y ,
a n d t h e s e a r c h s p a c e c a n b e r e d u c e d s u b s t a n t i a l l y .
H o w e v e r , i f t h e t r a n s a c t i o n d a t a b a s e i s v e r y l a r g e , w e
c a n n o t a s s u m e t h a t t h e F P - t r e e c a n a l w a y s b e h e l d
i n m a i n m e m o r y . I n n e x t s e c t i o n , w e d e v e l o p s o m e
t e c h n i q u e s t o e n s u r e t h e s c a l a b i l i t y o f C L O S E T i n
l a r g e d a t a b a s e s .
3 . 3 S c a l i n g u p C L O S E T i n l a r g e d a t a b a s e s
A s s p e c i e d i n t h e l a s t s e c t i o n , F P - t r e e c o n t r i b u t e s
s u b s t a n t i a l l y t o t h e e c i e n c y o f C L O S E T . W h e n
t h e t r a n s a c t i o n d a t a b a s e i s l a r g e , i t i s u n r e a l i s t i c t o
c o n s t r u c t a m a i n m e m o r y - b a s e d F P - t r e e . I n s u c h
c a s e s , w e c a n r s t c o n s t r u c t c o n d i t i o n a l d a t a b a s e s
w i t h o u t F P - t r e e , o r c o n s t r u c t d i s k - b a s e d F P - t r e e s
D i s k - b a s e d F P - t r e e h a s b e e n d i s c u s s e d i n 6 ] . I n t h i s
s e c t i o n , w e f o c u s o n b u i l d i n g c o n d i t i o n a l d a t a b a s e s
w i t h o u t F P - t r e e
A n a i v e m e t h o d i s t o e x p a n d a l l c o n d i t i o n a l
d a t a b a s e s f r o m o n e p a r e n t a t a t i m e . H o w e v e r ,
s u c h a m e t h o d b a s i c a l l y d u p l i c a t e s T D B
2
t i m e s ,
w h e r e l i s t h e a v e r a g e n u m b e r o f f r e q u e n t i t e m s i n
t r a n s a c t i o n s . I f t h e t r a n s a c t i o n d a t a b a s e i s v e r y
l a r g e , t h e t r a n s a c t i o n s a r e l o n g , a n d t h e r e a r e m a n y
f r e q u e n t i t e m s , c o n s t r u c t i o n o f m a n y c o n d i t i o n a l
d a t a b a s e s c o u l d b e a c o s t l y o p e r a t i o n .
H e r e , w e p r o p o s e a p a r t i t i o n - b a s e d a p p r o a c h , w h i c h
c a n r e d u c e t h e s p a c e c o s t d r a m a t i c a l l y . W e i l l u s t r a t e
t h e p r i n c i p l e u s i n g t h e f o l l o w i n g e x a m p l e .
E x a m p l e 3 L e t u s c o n s i d e r c o n s t r u c t i o n o f c o n d i -
t i o n a l d a t a b a s e s i n E x a m p l e 2 u s i n g a p a r t i t i o n - b a s e d
a p p r o a c h , a s d e m o n s t r a t e d i n F i g u r e 3 .
8/2/2019 Closet Algorithms
8/10
TDB
cefad
ea
cef
cfad
cef
a-cond. DBcef
e
cf
ea-conditional DB
cfa-conditional DB
ce
c
f-cond. DBce:3
c
e-cond. DBc:3
d-cond. DBcefa
cfa
F i g u r e 3 : C o n s t r u c t i n g c o n d i t i o n a l d a t a b a s e s i n
p a r t i t i o n - b a s e d a p p r o a c h .
I n t h e c o n s t r u c t i o n o f c o n d i t i o n a l d a t a b a s e s , i n -
s t e a d o f c o p y i n g a t r a n s a c t i o n t o e v e r y c o n d i t i o n a l
d a t a b a s e i t t a k e s p a r t i n , w e o n l y c o p y i t t o t h a t o f
t h e l a s t f l i s t i t e m i t c o n t a i n s . F o r e x a m p l e , d i s t h e
l a s t i t e m o f t h e f l i s t t h e r s t t r a n s a c t i o n c e f a d c o n -
t a i n s . S o , i n s t e a d o f b e i n g c o p i e d i n t o d - a - f - a n d
e - c o n d i t i o n a l d a t a b a s e s s i m u l t a n e o u s l y , t h e t u p l e i s
o n l y c o p i e d t o t h e d - c o n d i t i o n a l d a t a b a s e . A f t e r t h e
d - c o n d i t i o n a l d a t a b a s e i s p r o c e s s e d , t h e t r a n s a c t i o n
i s t r a n s f e r r e d t o t h e c o n d i t i o n a l d a t a b a s e o f t h e s e c -
o n d t o t h e l a s t i t e m a , a n d s o o n . I n s u c h a w a y , w e
g u a r a n t e e t h a t a t e a c h l e v e l o f r e c u r s i o n , t h e d a t a b a s e
i s p a r t i t i o n e d a t m o s t o n c e . B u t o n c e t h e p a r t i t i o n
i s d o n e , t h e o r i g i n a l d a t a b a s e c a n b e g o n e . S u c h
a p a r t i t i o n - b a s e d c o n d i t i o n a l d a t a b a s e c o n s t r u c t i o n
n e e d s t o s c a n t h e d a t a b a s e o n l y o n c e .
P l e a s e n o t e t h a t i n t h e p r o c e s s i n g o f a - c o n d i t i o n a l
d a t a b a s e , i t t a k e s o n e s c a n o f t h e a - c o n d i t i o n a l
d a t a b a s e t o p a r t i t i o n i t t o f a - a n d e a - c o n d i t i o n a l
d a t a b a s e s . A t t h e s a m e t i m e , t r a n s a c t i o n s i n t h e a -
c o n d i t i o n a l d a t a b a s e s h o u l d b e c o p i e d t o t h e f - a n d
e - c o n d i t i o n a l d a t a b a s e s . F i g u r e 3 s h o w s t h a t h o w
c e f a d i s c o p i e d t o v a r i o u s c o n d i t i o n a l d a t a b a s e s i n
t u r n . 2
W i t h t h e p a r t i t i o n - b a s e d c o n d i t i o n a l d a t a b a s e c o n -
s t r u c t i o n , C L O S E T c a n p r o c e e d w i t h o u t F P - t r e e a t
t h e r s t s e v e r a l r o u n d s w h e n t h e t r a n s a c t i o n d a t a b a s e
i s l a r g e , a n d F P - t r e e s a r e c o n s t r u c t e d o n l y w h e n t h e
s i z e o f c o n d i t i o n a l d a t a b a s e s c a n t i n m e m o r y .
O n e m a y w o n d e r i f w e s t i l l c a n u s e O p t i m i z a t i o n
3 w i t h o u t F P - t r e e . F o r t u n a t e l y , w e s t i l l c a n u s e i t b y
m a i n t a i n i n g o n e b r a n c h o f F P - t r e e . T h e s p i r i t i s t h a t
w e o n l y m a i n t a i n t h e u p p e r p o r t i o n o f F P - t r e e f r o m
t h e r o o t t o t h e r s t n o d e w i t h m o r e t h a n o n e s o n
b r a n c h .
4 P e r f o r m a n c e S t u d y
I n t h i s s e c t i o n , w e r e p o r t o u r p e r f o r m a n c e s t u d y o f
t h e t h r e e a l g o r i t h m s f o r m i n i n g f r e q u e n t c l o s e d i t e m -
s e t s : C L O S E T C H A R M , a n d A - c l o s e A - c l o s e n d s
f r e q u e n t c l o s e d i t e m s e t s b y ( 1 ) u s i n g t h e A p r i o r i
f r a m e w o r k , ( 2 ) p r u n i n g r e d u n d a n c i e s i n c a n d i d a t e s ,
a n d ( 3 ) p o s t - p r o c e s s i n g t o g e n e r a t e c o m p l e t e b u t
n o n - d u p l i c a t e r e s u l t . C H A R M e x p l o r e s a v e r t i c a l d a t a
f o r m a t , a n d n d f r e q u e n t c l o s e t i t e m s e t s b y c o m p u t -
i n g i n t e r s e c t i o n s o f s e t s o f t r a n s a c t i o n i d s ( t i d s ) f o r
i t e m s e t s .
A l l t h e e x p e r i m e n t s a r e p e r f o r m e d o n a 2 3 3 M H z
P e n t i u m P C w i t h 1 2 8 M B m a i n m e m o r y , r u n n i n g o n
M i c r o s o f t W i n d o w s / N T . A l l t h e p r o g r a m s a r e w r i t -
t e n i n M i c r o s o f t / V i s u a l C + + 6 . 0 . T h e A - c l o s e a n d
C H A R M a r e i m p l e m e n t e d a s d e s c r i b e d i n 9 ] a n d 1 0 ] .
W e u s e r u n t i m e , i . e . , t h e p e r i o d b e t w e e n i n p u t a n d
o u t p u t , t o r e p o r t o u r r e s u l t , i n s t e a d o f u s i n g C P U
t i m e m e a s u r e d i n s o m e l i t e r a t u r e .
W e t e s t t h e t h r e e m e t h o d s o n v a r i o u s d a t a s e t s ,
i n c l u d i n g s y n t h e t i c o n e s g e n e r a t e d b y t h e s t a n d a r d
p r o c e d u r e d e s c r i b e d i n 2 ] , a n d r e a l d a t a s e t s u s e d i n
4 , 1 0 ] . L i m i t e d b y s p a c e , w e r e p o r t e d h e r e o n l y t h e
r e s u l t s o n t h r e e d a t a s e t s a s f o l l o w s .
S y n t h e t i c d a t a s e t T 2 5 I 2 0 D 1 0 0 K w i t h 1 0 K i t e m s
I n t h i s d a t a s e t , t h e a v e r a g e t r a n s a c t i o n s i z e a n d
a v e r a g e m a x i m a l p o t e n t i a l l y f r e q u e n t i t e m s e t s i z e
a r e s e t t o 2 5 a n d 2 0 , r e s p e c t i v e l y , w h i l e t h e r e a r e
t o t a l l y 1 0 0 K t r a n s a c t i o n s . T h i s d a t a s e t i s s p a r s e .
M o s t o f f r e q u e n t i t e m s e t s a r e c l o s e d .
R e a l d a t a s e t I C o n n e c t - 4 . T h i s d a t a s e t i s
f r o m t h e U C - I r v i n e M a c h i n e L e a r n i n g D a t a b a s e
R e p o s i t o r y
4
. I t i s c o m p i l e d f r o m t h e C o n n e c t -
4 g a m e s t a t e i n f o r m a t i o n . T h e t o t a l n u m b e r o f
t r a n s a c t i o n s i s 6 7 5 5 7 , w h i l e e a c h t r a n s a c t i o n i s
w i t h 4 3 i t e m s . I t i s a d e n s e d a t a s e t w i t h a l o t o f
l o n g f r e q u e n t i t e m s e t s .
R e a l d a t a s e t I I p u m s b . T h i s d a t a s e t i s f r o m
t h e I B M A l m a d e n R e s e a r c h C e n t e r
5
. T h e r e a r e
4 9 0 4 6 t r a n s a c t i o n s i n i t , w h i l e e a c h t r a n s a c t i o n
h a s 7 4 i t e m s . I t i s a d e n s e d a t a s e t w i t h m a n y l o n g
f r e q u e n t i t e m s e t s .
4 . 1 R e d u c t i o n o f t h e s i z e o f i t e m s e t s
u s i n g f r e q u e n t c l o s e d i t e m s e t s
O u r e x p e r i m e n t s s h o w t h a t t h e n u m b e r o f f r e q u e n t
i t e m s e t s w h i c h n e e d t o b e r e p r e s e n t e d i n m i n i n g c a n
b e r e d u c e d b y a n o r d e r o f m a g n i t u d e i n a d e n s e
d a t a b a s e i f t h e y a r e r e p r e s e n t e d b y f r e q u e n t c l o s e d
i t e m s e t s . F o r e x a m p l e , T a b l e 2 l i s t s t h e n u m b e r s
4
h t t p : / / w w w . i c s . u c i . e d u / m l e a r n / M L R e p o s i t o r y . h t m l
5
h t t p : / / w w w . a l m a d e n . i b m . c o m / c s / q u e s t / d e m o s . h t m l
8/2/2019 Closet Algorithms
9/10
o f f r e q u e n t c l o s e d i t e m s e t s ( # F . C . I ) a n d f r e q u e n t
i t e m s e t s ( # F . I ) , a s w e l l a s t h e i r r a t i o , i n d a t a s e t
C o n n e c t - 4
S u p p o r t # F . C . I # F . I
# F . I
# F . C . I
6 4 1 7 9 ( 9 5 % ) 8 1 2 2 2 0 5 2 7 2
6 0 8 0 1 ( 9 0 % ) 3 4 8 6 2 7 1 2 7 7 7 8
5 4 0 4 6 ( 8 0 % ) 1 5 1 0 7 5 3 3 9 7 5 3 5 3 5
4 7 2 9 0 ( 7 0 % ) 3 5 8 7 5 4 1 2 9 8 3 9 1 1 5 1 2
T a b l e 2 : T h e n u m b e r o f f r e q u e n t c l o s e d i t e m s e t s
a n d f r e q u e n t i t e m s e t s i n d a t a s e t C o n n e c t - 4 . ( F . C . I f o r
f r e q u e n t c l o s e d i t e m s e t s a n d F . I f o r f r e q u e n t i t e m s e t s )
I f w e w a n t t o m i n e a s s o c i a t i o n r u l e s i n a d e n s e
d a t a b a s e , s u c h a s C o n n e c t - 4 , m i n i n g t h e s e t o f
f r e q u e n t c l o s e d i t e m s e t s a n d t h e n g e n e r a t i n g r u l e s
o n l y o n t h e m w i l l r e d u c e s e a r c h s p a c e s u b s t a n t i a l l y
a n d g e n e r a t e m u c h s m a l l e r s e t o f r u l e s . A s t h e
s u p p o r t t h r e s h o l d d e c r e a s e s , t h e s a v i n g b e c o m e s
i n c r e a s i n g l y s u b s t a n t i a l .
4 . 2 C o m p a r i s o n o f A - c l o s e C H A R M a n d
C L O S E T
T h e s c a l a b i l i t i e s o f A - c l o s e C H A R M a n d C L O S E T a r e
t e s t e d u s i n g v a r i o u s d a t a s e t s . C L O S E T o u t p e r f o r m s
b o t h C H A R M a n d A - c l o s e
A s s h o w n i n F i g u r e 4 , i n s p a r s e d a t a s e t I 2 0 T 2 5 1 0 0 K ,
a m a j o r i t y o f f r e q u e n t i t e m s e t s a r e c l o s e d i t e m s e t s .
T h e p e r f o r m a n c e o f A - c l o s e i s c l o s e t o t h a t o f A p r i o r i
T h e a d v a n t a g e o f C L O S E T o v e r A - c l o s e i s b a s i c a l l y
t h e s a m e a s t h a t o f F P - g r o w t h o v e r A p r i o r i . I n t h i s
d a t a s e t , C H A R M a l s o w i n s A p r i o r i . S i n c e t h e s u p p o r t
t h r e s h o l d i s l o w , a n d t h e t r a n s a c t i o n i d e n t i c a t i o n
( t i d ) s e t s f o r f r e q u e n t i t e m s e t s a r e r e l a t i v e l y s m a l l ,
C H A R M i s e c i e n t . B u t i t i s s l o w e r t h a n C L O S E T
T h e a d v a n t a g e o f C L O S E T b e c o m e s s i g n i c a n t o n
d e n s e d a t a s e t s . T h e r e s u l t s o n d a t a s e t C o n n e c t -
4 i s s h o w n i n F i g u r e 5 . P l e a s e n o t e t h a t t h e
r u n t i m e i n t h i s g u r e i s i n l o g a r i t h m i c s c a l e . F o r
e x a m p l e , C L O S E T u s e s o n l y 1 6 9 0 s e c o n d s t o n d
o u t t h e c o m p l e t e s e t o f 1 3 0 1 0 1 f r e q u e n t c l o s e d
i t e m s e t s , w h e n t h e s u p p o r t t h r e s h o l d i s s e t t o 3 3 7 7 9
( 5 0 % ) . A - c l o s e e v e n c a n n o t n d t h e r e s u l t f o r s u p p o r t
t h r e s h o l d 5 4 0 4 6 ( 8 0 % ) w i t h i n t h a t t i m e .
P u m s b i s a c h a l l e n g i n g d a t a s e t . T h e r e s u l t s o v e r
t h i s d a t a s e t a r e s h o w n i n F i g u r e 6 . A - c l o s e u s e s
m o r e t h a n 2 5 0 s e c o n d s t o n d o u t t h e f r e q u e n t
c l o s e d i t e m s e t s f o r s u p p o r t t h r e s h o l d 9 0 % , b u t
C L O S E T n e e d s o n l y l e s s t h a n 1 0 0 s e c o n d s t o n d o u t
t h a t f o r s u p p o r t t h r e s h o l d 8 0 % .
F r o m t h e e x p e r i m e n t s , w e c a n o b s e r v e t h a t a
n o n - t r i v i a l c o s t o f C H A R M i s f r o m m a n y i n t e r s e c t i o n
o p e r a t i o n s o v e r l a r g e s e t s o f t i d s . F o r e x a m p l e , i n
d a t a s e t C o n n e c t - 4 , i f t h e s u p p o r t t h r e s h o l d i s s e t t o
9 5 % , e a c h s e t o f t i d s o f f r e q u e n t i t e m s e t c o n t a i n s a t
l e a s t 6 7 5 5 7 9 5 % = 6 4 1 7 9 t i d s
I n o r d e r t o t e s t t h e s c a l a b i l i t y o f C L O S E T w e
g e n e r a t e t h e s y n t h e t i c d a t a s e t s w i t h s i z e i n 2 t o 1 0
t i m e s , a n d r e p l i c a t e t h e t r a n s a c t i o n s o f r e a l d a t a s e t s 2
t o 1 0 t i m e s . W e k e e p t h e s u p p o r t t h r e s h o l d c o n s t a n t
i n p e r c e n t a g e . T h e r e s u l t s a r e s h o w n i n F i g u r e
7 . T h e g u r e s h o w s t h a t C L O S E T i s s c a l a b l e w i t h
t h e i n c r e a s e o f t h e n u m b e r o f t r a n s a c t i o n s . I t i s
i n t e r e s t i n g t o s e e t h a t t h e r u n t i m e o f C L O S E T o v e r
r e a l d a t a s e t s i n c r e a s e s m u c h s l o w e r t h a n t h e s i z e s
o f r e a l d a t a s e t s d o . T h a t i s b e c a u s e C L O S E T s c a n s
t h e t r a n s a c t i o n d a t a b s e s o n l y t w i c e . A f t e r t h a t ,
t h e m i n i n g i s c o n n e d t o t h e F P - t r e e . N o m a t t e r
h o w m a n y t i m e s t h e d a t a s e t s a r e r e p l i c a t e d , t h e
F P - t r e e r e m a i n s i n t h e s a m e s h a p e w i t h r e s p e c t t o
t h e c o n s t a n t s u p p o r t t h r e s h o l d i n p e r c e n t a g e .
I n s u m m a r y , C L O S E T i s e c i e n t a n d s c a l a b l e i n
m i n i n g f r e q u e n t c l o s e d i t e m s e t s i n l a r g e d a t a b a s e s .
I t i s m u c h f a s t e r t h a n A - c l o s e , a n d a l s o f a s t e r t h a n
C H A R M
5 C o n c l u s i o n s
M i n i n g c o m p l e t e s e t o f i t e m s e t s o f t e n s u e r s f r o m
g e n e r a t i n g a v e r y l a r g e n u m b e r o f i t e m s e t s a n d
a s s o c i a t i o n r u l e s . M i n i n g f r e q u e n t c l o s e d i t e m s e t s
p r o v i d e s a n i n t e r e s t i n g a l t e r n a t i v e s i n c e i t i n h e r i t s
t h e s a m e a n a l y t i c a l p o w e r a s m i n i n g t h e w h o l e s e t
o f f r e q u e n t i t e m s e t s b u t g e n e r a t e s a m u c h s m a l l e r
s e t o f f r e q u e n t i t e m s e t s a n d l e a d s t o l e s s a n d m o r e
i n t e r e s t i n g a s s o c i a t i o n r u l e s t h a n t h e f o r m e r .
I n t h i s p a p e r , w e p r o p o s e d a n F P - t r e e - b a s e d d a t a b a s e
p r o j e c t i o n m e t h o d , C L O S E T , f o r e c i e n t m i n i n g o f
f r e q u e n t c l o s e d i t e m s e t s i n l a r g e d a t a b a s e s . O u r p r o -
p o s e d a l g o r i t h m , C L O S E T , f o r m i n i n g c l o s e d i t e m -
s e t s a d o p t s t h r e e t e c h n i q u e s : ( 1 ) a p p l y i n g a c o m -
p r e s s e d , f r e q u e n t p a t t e r n t r e e F P - t r e e s t r u c t u r e f o r
m i n i n g c l o s e d i t e m s e t s w i t h o u t c a n d i d a t e g e n e r a t i o n ,
( 2 ) d e v e l o p i n g a s i n g l e p r e x p a t h c o m p r e s s i o n t e c h -
n i q u e t o i d e n t i f y f r e q u e n t c l o s e d i t e m s e t s q u i c k l y , a n d
( 3 ) e x p l o r i n g a p a r t i t i o n - b a s e d p r o j e c t i o n m e c h a n i s m
f o r s c a l a b l e m i n i n g i n l a r g e d a t a b a s e s .
O u r p e r f o r m a n c e s t u d y s h o w s t h a t C L O S E T i s
e c i e n t a n d s c a l a b l e o v e r l a r g e d a t a b a s e s , a n d i s
f a s t e r t h a n t h e p r e v i o u s l y p r o p o s e d m e t h o d s .
A c k n o w l e d g e m e n t s
W e w o u l d l i k e t o e x p r e s s o u r t h a n k s t o N i c o l a s
P a s q u i e r a n d L o t L a k h a l f o r p r o m p t l y s e n d i n g
u s t h e i r r e c e n t p a p e r s o n f r e q u e n t c l o s e d i t e m s e t s .
W e a l s o t h a n k t h e a n o n y m o u s r e v i e w e r s f o r t h e i r
c o m m e n t s .
8/2/2019 Closet Algorithms
10/10
F i g u r e 4 : S c a l a b i l i t y w i t h s u p p o r t t h r e s h -
o l d o n s p a r s e d a t a s e t T 2 5 I 2 0 D 1 0 0 K .
F i g u r e 5 : S c a l a b i l i t y w i t h s u p p o r t t h r e s h -
o l d o n d e n s e d a t a s e t C o n n e c t - 4
F i g u r e 6 : S c a l a b i l i t y w i t h s u p p o r t t h r e s h -
o l d o n d e n s e d a t a s e t p u m s b . F i g u r e 7 : S i z e s c a l e u p o n d a t a s e t s .
R e f e r e n c e s
1 ] R . A g a r w a l , C . A g g a r w a l , a n d V . V . V . P r a s a d . A
t r e e p r o j e c t i o n a l g o r i t h m f o r g e n e r a t i o n o f f r e q u e n t
i t e m s e t s . I n J o u r n a l o f P a r a l l e l a n d D i s t r i b u t e d
C o m p u t i n g ( S p e c i a l I s s u e o n H i g h P e r f o r m a n c e D a t a
M i n i n g ) , ( t o a p p e a r ) , 2 0 0 0 .
2 ] R . A g r a w a l a n d R . S r i k a n t . F a s t a l g o r i t h m s f o r
m i n i n g a s s o c i a t i o n r u l e s . I n P r o c . 1 9 9 4 I n t . C o n f .
V e r y L a r g e D a t a B a s e s ( V L D B ' 9 4 ) , p a g e s 4 8 7 { 4 9 9 ,
S a n t i a g o , C h i l e , S e p t e m b e r 1 9 9 4 .
3 ] R . A g r a w a l a n d R . S r i k a n t . M i n i n g s e q u e n t i a l
p a t t e r n s . I n P r o c . 1 9 9 5 I n t . C o n f . D a t a E n g i n e e r i n g
( I C D E ' 9 5 ) , p a g e s 3 { 1 4 , T a i p e i , T a i w a n , M a r c h 1 9 9 5 .
4 ] R . J . B a y a r d o . E c i e n t l y m i n i n g l o n g p a t t e r n s f r o m
d a t a b a s e s . I n P r o c . 1 9 9 8 A C M - S I G M O D I n t . C o n f .
M a n a g e m e n t o f D a t a ( S I G M O D ' 9 8 ) , p a g e s 8 5 { 9 3 ,
S e a t t l e , W a s h i n g t o n , J u n e 1 9 9 8 .
5 ] J . H a n , G . D o n g , a n d Y . Y i n . E c i e n t m i n i n g o f
p a r t i a l p e r i o d i c p a t t e r n s i n t i m e s e r i e s d a t a b a s e . I n
P r o c . 1 9 9 9 I n t . C o n f . D a t a E n g i n e e r i n g ( I C D E ' 9 9 )
p a g e s 1 0 6 { 1 1 5 , S y d n e y , A u s t r a l i a , A p r i l 1 9 9 9 .
6 ] J . H a n , J . P e i , a n d Y . Y i n . M i n i n g f r e q u e n t
p a t t e r n s w i t h o u t c a n d i d a t e g e n e r a t i o n . I n P r o c . 2 0 0 0
A C M - S I G M O D I n t . C o n f . M a n a g e m e n t o f D a t a
( S I G M O D ' 0 0 ) , D a l l a s , T X , M a y 2 0 0 0 .
7 ] H . M a n n i l a , H . T o i v o n e n , a n d A . I . V e r k a m o .
E c i e n t a l g o r i t h m s f o r d i s c o v e r i n g a s s o c i a t i o n r u l e s .
I n P r o c . A A A I ' 9 4 W o r k s h o p K n o w l e d g e D i s c o v e r y i n
D a t a b a s e s ( K D D ' 9 4 ) , p a g e s 1 8 1 { 1 9 2 , S e a t t l e , W A ,
J u l y 1 9 9 4 .
8 ] H . M a n n i l a , H T o i v o n e n , a n d A . I . V e r k a m o . D i s -
c o v e r y o f f r e q u e n t e p i s o d e s i n e v e n t s e q u e n c e s . D a t a
M i n i n g a n d K n o w l e d g e D i s c o v e r y , 1 : 2 5 9 { 2 8 9 , 1 9 9 7 .
9 ] N . P a s q u i e r , Y . B a s t i d e , R . T a o u i l , a n d L . L a k h a l .
D i s c o v e r i n g f r e q u e n t c l o s e d i t e m s e t s f o r a s s o c i a t i o n
r u l e s . I n P r o c . 7 t h I n t . C o n f . D a t a b a s e T h e o r y
( I C D T ' 9 9 ) , p a g e s 3 9 8 { 4 1 6 , J e r u s a l e m , I s r a e l , J a n -
u a r y 1 9 9 9 .
1 0 ] M . J . Z a k i a n d C . H s i a o . C h a r m : A n e c i e n t a l g o -
r i t h m f o r c l o s e d a s s o c i a t i o n r u l e m i n i n g . I n T e c h n i c a l
R e p o r t 9 9 - 1 0 , C o m p u t e r S c i e n c e , R e n s s e l a e r P o l y -
t e c h n i c I n s t i t u t e , 1 9 9 9 .