Professional Documents
Culture Documents
Shengnan Cong
Jiawei Han
General Terms
Algorithms, Design, Experimentation, Performance
Keywords
data mining, load balancing, parallel algorithms, sampling
1. INTRODUCTION
Data mining is a process to extract patterns from a large
collections of data [13]. Due to the wide availability of large
datasets and the desire of turning such datasets into useful information and knowledge, data mining has attracted a
great deal of attention in recent years.
One important problem in data mining is the discovery of frequent itemsets in a transactional database [3].
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that copies
bear this notice and the full citation on the first page. To copy otherwise, to
republish, to post on servers or to redistribute to lists, requires prior specific
permission and/or a fee.
PPoPP05, June 1517, 2005, Chicago, Illinois, USA.
Copyright 2005 ACM 1-59593-080-9/05/0006 ...$5.00.
Jay Hoeflinger
David Padua
jay.p.hoeflinger@intel.com
The frequent itemset mining problem can be stated as follows: Let I = {i1 , i2 , ..., im } be a set of items, and DB =
{T1 , T2 , ..., Tn } be a database where Ti (i [1..n]), called
transactions, are subsets of items in I(i.e. Ti 2I ). The
support (or occurrence frequency) of an itemset A(A 2I )
is the fraction of transactions containing A in DB. A is a
frequent itemset if As support is no less than a predefined
support threshold. The frequent itemsets mining problem is to find all frequent itemsets in a database. Frequent
itemset mining problem has a wide range of applications including correlation [6], cluster analysis [5] and associative
classification [18].
Sequential pattern mining is another important problem
in data mining [4]. Its objective is to discover frequent subsequences in a sequence database. Let I = {i1 , i2 , ..., in }
be a set of items. A sequence s is a tuple, denoted as
hT1 , T2 , ..., Tl i, where the Tj (1 j l), are called events
or itemsets. Each event is a set denoted as (x1 , x2 , ..., xm )
where xk (1 k m) is an item. A sequence database S
is a set of sequences. A sequence = ha1 , a2 ...an i is called a
subsequence of another sequence = hb1 , b2 ...bm i, if there
exist integers 1 j1 j2 ... jn m such that a1 bj1 ,
a2 bj2 ,...,an bjn . If is a subsequence of , we say that
contains . The support of a sequence in a sequence
database S is the number of sequences in the database containing as a subsequence. The sequential pattern mining problem is to find all the subsequences whose support
values are no less than a predefined support threshold. Sequential pattern mining can be applied to many real-world
applications, such as the analysis of customer purchase patterns or web access patterns [8], the analysis of natural disasters or alarm sequences [27], and the analysis of disease
treatments or DNA sequences [25].
The best algorithms for both frequent itemset mining
problem and sequential pattern mining problem are based
on pattern-growth[14], a divide-and-conquer algorithm that
projects and partitions databases based on the currently
identified frequent patterns and grow such patterns to longer
ones using the projected databases.
In this paper, we propose a framework for parallel mining frequent itemset and sequential patterns. The partition
into tasks is based on the divide-and-conquer strategy of the
pattern-growth algorithm so that the inter-processor communication is minimized.
One problem we must handle is the possibility of an unbalanced workload because the size of the projected databases
may vary greatly. We have observed that the mining time
of the largest task may be tens or even hundreds of times
2.
2.1
#Transactions
#Items
mushroom
8,124
23
23
connect
57,557
43
43
pumsb
49,046
7,116
74
pumsb_star
49,046
7,116
63
T40I10D100K
100,000
999
77
T50I5D500K
500,000
5,000
94
(a)
#Sequences
#Items
Items bought
{f, a, c, d, g, i, m, p}
{a, b, c, f, l, m, o}
{b, f, h, j, o }
{b, c, k, s, p }
{a, f, c, e, l, p, m, n}
(a)
TID=200
inserted
TID=300
inserted
root
root
f:1
f:2
f:3
c:1
c:2
c:2
a:1
a:2
a:2
Initial TID=100
inserted
root
root
TID=400
inserted
TID=500
inserted
root
f:3
b:1
c:2
b:1
a:2
root
f:4
c:1
b:1
c:3
p:1
a:3
c:1
b:1
b:1
p:1
m:1
m:1
b:1
m:1
b:1
m:1
b:1
m:2
b:1
p:1
p:1
m:1
p:1
m:1
p:1
m:1
p:2
m:1
root
Ave.
#Events/sequence
Ave
#Items/Event
C10N0.1T8S8I8
10,000
1,000
C50N10T8S20I2.5
50,000
10,000
20
C100N5T2.5S10I1.25
100,000
5,000
10
2.5
C200N10T2.5S10I1.25
200,000
10,000
10
2.5
C100N20T2.5S10I1.25
100,000
20,000
10
2.5
(b)
TID
100
200
300
400
500
(c)
Transactional datasets
Dataset
FP-growth algorithm[15] uses a tree structure, called FPtree, to store the information about frequent itemsets. Every
branch (from the root) of the FP-tree represents a transaction pattern in the database. The items are organized in
the tree in descending order of their frequencies. The items
with higher frequency are located closer to the root. The
FP-tree has a header table which contains all frequent items
in the database and their occurrence counts. An entry in
the header table is the starting point of a list that links all
the nodes in the FP-tree referring to an item.
f:4
Item frequency
f
4
c
4
a
3
b
3
m
3
p
3
c:3
c:1
b:1
a:3
Header Table
(d)
b:1
p:1
m:2
b:1
p:2
m:1
Sequence datasets
root
fca:2
fcab:1
f:1
c:1
a:1
projected database of m
function F(T)
begin
if (T is a chain) return set of all combinations of T;
else return iHeader(T ) ((i F (P (i, T ))) {i});
end
<(a)(abc)(ac)(d)(cf)>
20
<(ad)(c)(bc)(ae)>
30
<(ef)(ab)(df)(c)(b)>
<(e)(g)(af)(c)(b)(c)>
(a)
Prefix
<(a)>
<(b)>
<(c)>
<(d)>
<(e)>
<(f)(ab)(df)(c)(b)>, <()(af)(c)(b)(c)>
<(f)>
<()(ab)(df)(c)(b)>, <()(c)(b)(c)>
(b)
Sequence
10
40
FP-tree for ms
projected database
Sequence_id
3.
PARALLELIZING FRAMEWORK
pumsb
Mining time (in seconds)
250
Task mining time (max=204.7sec)
200
150
100
50
0
11
16
21
26
31
36
41
46
51
3. Each processor mines its projected database asynchronously in a pattern-growth manner without interprocessor communication.
Because the projected databases are independent, there
is no inter-processor communication involved after the task
scheduling. Each processor just mines its own projected
database using sequential FP-growth or PrefixSpan. However, although the communication has been minimized, another issue has to be considered, which is load balancing. In
fact, the inherent task partition of pattern-growth method
may result in extremely imbalanced workload among the
processors because the cost of processing the projected databases may vary greatly. From our experiments, the mining
time of the largest task may be tens, or even hundreds, of
times longer than the average mining time of all the other
tasks. Figure 5 shows the mining time distribution of the
projected databases for two databases. Figure 5(a) is the
transactional dataset pumsb for frequent itemset mining.
Figure 5(b) is for the sequence dataset C10N0.1T8S8I8 for
sequential pattern mining. Figure 6 shows the average and
maximum mining time of the projected databases for all the
datasets we tested.
This imbalanced workload greatly restricts the scalability
of parallelism. To address this problem, we have to identify
which projected databases take much longer time than the
others and split them into smaller ones.
30
25
20
15
10
5
0
1
101
201
301
401
501
601
701
801
901
C10N0.1T8S8I8
35
(b)
4.
SAMPLING TECHNIQUE
4.1
Random Sampling
Mushroom
Connect
Pumsb
Pumsb_star
0.17
2.37
26.7
21.9
Maximum (sec)
16.2
13.5
204.6
899.6
Whole dataset
1% random sample
C10N0.1T8S8I8
35
0.03
T40I10D100K
T50I5D500K
Average (sec)
0.48
0.56
Maximum (sec)
44.2
58.6
Dataset
C10N0.1T8S8I8
C50N10T8S20I2.5
C100N5T2.5S10I1.25
Average (sec)
0.14
0.028
0.037
Maximum (sec)
29.1
7.47
7.84
Dataset
C200T2.5S10I1.25
C100N20T2.5S10I1.25
Average (sec)
0.038
0.047
21.9
7.99
Maximum (sec)
30
Dataset
0.025
25
0.02
20
0.015
15
0.01
10
0.005
Dataset
Average (sec)
101
201
301
401
501
601
701
801
901
pumsb
0.5
250
0.4
0.35
0.3
150
0.25
0.2
100
0.15
0.1
50
0.45
200
0.05
0
0
1
11
16
21
26
31
36
41
46
51
We devised a sampling technique, called selective sampling, which has proved to be quite accurate in identifying
the large items. Instead of randomly selecting a fraction of
transactions or sequences from the dataset, selective sampling analyzes the information of every transaction or sequences in the dataset.
4.2.2
We examine the effectiveness of selective sampling by comparing the mining time of the projected databases for the
selective sample with the mining time for the whole dataset.
The two curves match quite well in all datasets. For instance, in the case of frequent itemset mining, Figure 9
shows our experimental results of selective sampling for the
same dataset as Figure 7 with t set to 20%. The mining time
of items 110 are missing in the selective sample curve because these items are the top 20% most frequent items and
are discarded during selective sampling. However, since the
actual mining time of these top 20% items is little, this does
not affect balancing the load of each processor and it also
proves the feasibility of our selective sampling strategy. Figure 10 gives the results of selective sampling for sequential
pattern mining with the dataset C10N0.1T8S8I8. The average sequence length of C10N0.1T8S8I8 is 64 and we set t
as 75% so that l is 48. As we can see, the two curves are
pumsb
0.6
0.5
200
0.4
150
0.3
100
0.2
50
0.1
250
11
16
21
26
31
36
41
46
51
Wole dataset
Selective sample
C10N0.1T8S8I8
30
0.25
25
0.2
20
0.15
15
0.1
10
0.05
5
0
0.3
35
Overhead
1.80%
0.71%
2.90%
2.05%
0.28%
Dataset
C10N0.1T8S8I8
C50N10T8S20I2.5
C100N5T2.5S10I1.25
Overhead
0.51%
0.71%
0.60%
Dataset
Overhead
C200T2.5S10I1.25
C100N20T2.5S10I1.25
0.87%
0.53%
0
1
0
1
101
201
301
401
501
601
701
801
901
4.2.3
Dataset
4.2.4
4. Task scheduling
Task scheduling consists of two parts. Part I is to
schedule the projections corresponding to the frequent
items which appear in the sample and Part II is to
schedule the projection of items which are the top 20%
most frequent items found in Step 1 and have been
discarded during the sampling. For Part I, since we
have identified the large projections with selective sampling, these large projections are further partitioned
into subtasks and then scheduled evenly in a roundrobin way. For the small projections, we have recorded
their sample mining time so we schedule them using a
bin-packing heuristic. For Part II, since the projected
databases take little time to be mined, they are scheduled evenly with round-robin.
For performance enhancement, we apply one optimization
before applying selective sampling. If M
> 10 where M is
P
the number of frequent items, we will use round-robin strategy instead of selective sampling to partition the frequent
> 10, each processor has
items. This is because when M
P
more than 10 tasks on average, and thus the number of tasks
is large enough so that it tends to balance the load. Therefore, it becomes unnecessary to do the sampling-based task
partition. This optimization can improve the performance
when P is small or M is very large.
5.
5.1
EXPERIMENTAL RESULTS
Experimental Setups
5.2
We implemented a parallel frequent itemset mining algorithm and a parallel sequential pattern mining algorithm
based on FP-growth and PrefixSpan respectively. Our parallel implementation follows the framework proposed in Section 3 and applies the selective sampling technique discussed
in Section 4. We named our parallel frequent itemset mining algorithm Par-FP, and the parallel sequential pattern
mining algorithm Par-ASP. We measured speedups to examine the scalability of our parallel algorithms. For each
dataset we executed our algorithms on 2, 4, 8, 16, 32 and
64 processors and compared the mining time to that of the
sequential FP-growth algorithm for frequent pattern mining
and with PrefixSpan algorithm for sequential pattern mining. The speedups of Par-FP and Par-ASP are shown in
Figure 12 and Figure 13 respectively.
From the graphs, we can see that both Par-FP and ParASP have obtained good speedups on most of the datasets
we tested. The speedups are scalable up to 64 processors
on our 64-processor system. For frequent itemset mining,
Par-FP shows better speedups on synthetic datasets than
real ones. This is because synthetic datasets have more frequent items and, after the large projected databases are partitioned, the sub-databases derived are of similar size. However, in real datasets, the number of frequent items is small
and even when the large tasks are partitioned into smaller
subtasks, the size of the subtasks may still be larger, or even
much larger as in pumb star, than those small tasks, which is
also the reason for the flattening speedup of C10N0.1T8S8I8
for Par-ASP.
In order to illustrate the effectiveness of the selective sampling technique, we compared the performance of Par-FP
and Par-ASP to the straight parallel implementations with
selective sampling turned off on 64 processors. Figure 14
and Figure 15 show the difference of speedups for frequent
itemset mining and sequential pattern mining respectively.
As we can see from the graphs, selective sampling can improve the efficiency of the parallel implementation in all the
cases we tested. For most of the cases, the speedups can be
enhanced by more than 50%. Selective sampling is able to
greatly improve the scalability of the parallelization.
mushroom
connect
64
optimal
Par-FP
32
32
16
16
16
Speedups
32
8
4
8
Processor Number
16
32
64
pumsb_star
8
Processor Number
16
32
64
16
16
16
Speedups
32
Speedups
32
8
4
8
Processor Number
16
32
64
8
Processor Number
16
32
64
8
Processor Number
16
32
optimal
Par-FP
64
optimal
Par-FP
32
T50I5D500K
64
optimal
Par-FP
T40I10D100K
64
optimal
Par-FP
Speedups
pumsb
64
optimal
Par-FP
Speedups
Speedups
64
64
8
Processor Number
16
32
64
C100N5T2.5S10I1.25
C50N10T8S20I2.5
C10N0.1T8S8I8
64
optimal
Par-ASP
64
optimal
Par-ASP
32
16
16
16
Speedups
32
Speedups
32
8
4
8
Processor Number
16
32
64
8
Processor Number
16
32
64
C100N20T2.5S10I1.25
32
16
16
8
Processor Number
8
Processor Number
16
32
64
optimal
Par-ASP
64
optimal
Par-ASP
32
C200N10T2.5S10I1.25
64
Speedups
optimal
Par-ASP
Speedups
Speedups
64
8
Processor Number
16
32
64
16
32
64
40
without sampling
with sampling
35
Speedups
30
25
20
15
10
5
Figure 14:
Par-FP
T4
0
T5
0
I1
I5
D5
0
0D
10
0K
0K
r
ta
_s
m
sb
pu
m
us
co
pu
nn
hr
oo
ec
m
sb
Effectiveness of selective-sampling on
40
without sampling
with sampling
35
30
Speedups
25
20
15
10
5
Figure 15:
Par-ASP
25
20
0N
10
T2
.5
S1
0I
1.
25
10
C
0N
20
10
T2
.5
0.
S1
1T
0I
8S
0I
S2
T8
10
N
C
50
1.
8I
5
2.
5
.2
I1
10
5S
2.
5T
0N
C
10
Effectiveness of selective-sampling on
6. FUTURE WORK
There are several optimizations which can further improve
the performance and scalability of the parallel algorithms
built with our framework.
First, as is shown in Figure 12 and Figure 13, the speedups
of datasets pumsb star and C10N0.1T8S8I8 are not satisfactory. This is because of load imbalance. The mining time
of some large items is so large that the subtasks derived from
them are still much bigger than the small tasks. To solve this
problem, the large subtasks need to be further divided into
smaller ones, which is to conduct multi-level task partition.
Then we need to estimate which subtasks need to be further
divided and how many levels are necessary. The selective
sampling technique can be extended to fulfill this duty. In
addition to just recording the mining time corresponding to
the frequent-1 items during the sample mining, we may also
record the mining time of their subtasks. From our experiments, the mining time curves of subtasks by selective sampling still match quite well with the corresponding curves
of the whole dataset. So we can recursively use the curves
obtained from sampling to identify the large subtasks.
Second, although the average overhead of selective sampling is only 1.1% of the sequential mining time on average
for both Par-FP and Par-Span, such overhead will become
7.
RELATED WORK
The parallel frequent itemset mining algorithms published are mostly based on candidate generation-and-test
approach[2, 12, 20, 30, 7, 23]. Despite the various heuristics
used to improve the efficiency, they still suffer from costly
database scans, communications and synchronizations. This
greatly limit the efficiency of these parallel algorithms2 .
As far as we know, there are three parallel frequent itemset mining algorithms based on pattern-growth methods [28,
17, 22]. The algorithm presented in [28] targets a sharedmemory system. Although it is possible to apply the algorithm to a distributed-memory system by replicating the
shared read-only FP-tree, it will not efficiently use the aggregate memory of the system and will suffer of the same
memory constraint of the sequential algorithm. In [17] the
FP-growth algorithm is parallelized for a distributed memory system and reports the speedups only of 8 and fewer
processors. Both [28] and [17] did not address the load balancing problem. In [22], the load balancing problem is handled using a granularity control mechanism. The effectiveness of such mechanism depends on the optimal value of a
parameter. However, the paper does not show an effective
way to obtain such value at run time.
In [26], the authors proposed a parallel itemset mining
algorithm, named D-Sampling, based on mining a random
sample of the datasets. However, different from our work,
the sampling here is not used to estimate the relative mining time, but to trade off between accuracy and efficiency.
D-sampling algorithm mines all frequent itemsets within a
predefined error, based on the mining results of the random
sampling.
We are aware of three papers on the parallelization of sequential pattern mining[24, 29, 11]. The method in [24] is
based on a candidate generation-and-test approach. The
scheme involves exchanging the remote database partitions
during each iteration, resulting in high communication cost
and synchronization overhead. In [11], the author presents a
parallel tree-projection-based algorithm and proposed both
static and dynamic strategies for task assignment. The
tree-projection based algorithm is also based on candidate
generation-and-test approach, which is often less efficient
than the pattern-growth approach used in our Par-ASP[21].
The static task assignment strategy presented is based on
bin-packing and bipartite graph partitioning. Although it
works well with some datasets, it may lead to unbalanced
2
In [23], the number of bytes transmitted was claimed to be
reduced, but no data of performance was reported
work distribution in some cases. The dynamic task assignment proposed uses a protocol to balance the workload of the
processors, which may introduce large inter-processor communications. The method proposed in [29] targets shared
memory systems. As the database is shared among processors, a dynamic strategy followed a work-pool model and
fine-grained synchronizations can be used to balance the
work load. This method is not always effective in a distributed memory system.
8. CONCLUSIONS
In this paper, we introduce a framework for parallel
mining frequent itemset and sequential patterns, based on
the divide-and-conquer property of the pattern growth algorithm. However, such a divide-and-conquer property,
though minimizing inter-processor communication, causes
load balancing problems, which restricts the scalability of
parallelization. We present a sampling technique, called selective sampling, to address this problem. We implemented
parallel frequent itemsets and sequential pattern mining algorithms with our framework. The experimental results
have shown that our parallel algorithms have achieved good
speedups on various datasets on at least 64 processors.
9. ACKNOWLEDGMENTS
This material is based upon work supported by the National Science Foundation(NGS program) under Grant No.
0103610. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the
author(s) and do not necessarily reflect the views of the National Science Foundation.
10. REFERENCES
[1] http://fimi.cs.helsinki.fi/fimi03/.
[2] R. Agrawal and J. C. Shafer. Parallel mining of
association rules. Ieee Trans. On Knowledge And Data
Engineering, 8:962969, 1996.
[3] R. Agrawal and R. Srikant. Fast algorithms for mining
association rules. In Proc. 20th Int. Conf. Very Large
Data Bases, VLDB, pages 487499. Morgan
Kaufmann, 1215 1994.
[4] R. Agrawal and R. Srikant. Mining sequential
patterns. In Eleventh International Conference on
Data Engineering, pages 314, Taipei, Taiwan, 1995.
[5] F. Beil, M. Ester, and X. Xu. Frequent term-based
text clustering. In Proceedings of the eighth ACM
SIGKDD international conference on Knowledge
discovery and data mining, pages 436442, 2002.
[6] S. Brin, R. Motwani, and C. Silverstein. Beyond
market baskets: Generalizing association rules to
correlations. In SIGMOD 1997, Proceedings ACM
SIGMOD International Conference on Management of
Data, May 13-15, 1997, Tucson, Arizona, USA, pages
265276. ACM Press, 1997.
[7] D. W. Cheung, J. Han, V. T. Ng, A. W. Fu, and
Y. Fu. A fast distributed algorithm for mining
association rules. In Proceedings of the fourth
international conference on on Parallel and distributed
information systems, pages 3143. IEEE Computer
Society, 1996.