Mining Closed High-Utility Itemsets from a transaction database with utility information using the CHUD Algorithm (SPMF documentation)

This example explains how to run the CHUD algorithm using the SPMF open-source data mining library.

How to run this example?

What is CHUD?

CHUD (Wu et al., 2011, Tseng et al., 2015) is an algorithm for discovering closed high-utility itemsets in a transaction database containing utility information.

There has been many work on the topic of high-utility itemset mining. A limitation of many high-utility itemset mining algorithms is that they generate too much itemsets as output. The CHUD algorithm was designed to discover only the high-utility itemsets that are closed. The concept of closed itemset was previously introduced in frequent itemset mining. An itemset is closed if it has no subset having the same support (frequency) in the database. In terms of application to transaction database, the concept of closed itemset can be understood as any itemset that is the largest set of items bought in common by a given set of customers. For more details, see the conference paper by Wu et al. (2011), or the extended journal paper published in 2015. These paper provides more details about the motivation for mining closed high-utility itemsets.

It is to be noted that CHUD is not the most efficient algorithm for discovering closed high utility itemsets. An improved version of CHUD called CHUI-Miner was then proposed (also offered in SPMF) and recently another algorithm called EFIM-Closed was proposed (also offered in SPMF).

What is the input?

CHUD takes as input a transaction database with utility information and a minimum utility threshold min_utility (a positive integer). Let's consider the following database consisting of 5 transactions (t1,t2...t5) and 7 items (1, 2, 3, 4, 5, 6, 7). This database is provided in the text file "DB_utility.txt" in the package ca.pfv.spmf.tests of the SPMF distribution.


Items Transaction utility Item utilities for this transaction
t1 3 5 1 2 4 6 30 1 3 5 10 6 5
t2 3 5 2 4 20 3 3 8 6
t3 3 1 4 8 1 5 2
t4 3 5 1 7 27 6 6 10 5
t5 3 5 2 7 11 2 3 4 2

Each line of the database is:

Note that the value in the second column for each line is the sum of the values in the third column.

What are real-life examples of such a database? There are several applications in real life. One application is a customer transaction database. Imagine that each transaction represents the items purchased by a customer. The first customer named "t1" bought items 3, 5, 1, 2, 4 and 6. The amount of money spent for each item is respectively 1 $, 3 $, 5 $, 10 $, 6 $ and 5 $. The total amount of money spent in this transaction is 1 + 3 + 5 + 10 + 6 + 5 = 30 $.

What is the output?

The output of CHUD is the set of closed high utility itemsets having a utility no less than a min_utility threshold (a positive integer) set by the user. To explain what is a closed high utility itemset, it is necessary to review some definitions.

An itemset is an unordered set of distinct items. The utility of an itemset in a transaction is the sum of the utility of its items in the transaction. For example, the utility of the itemset {1 4} in transaction t1 is 5 + 6 = 11 and the utility of {1 4} in transaction t3 is 5 + 2 = 7. The utility of an itemset in a database is the sum of its utility in all transactions where it appears. For example, the utility of {1 4} in the database is the utility of {1 4} in t1 plus the utility of {1 4} in t3, for a total of 11 + 7 = 18. A high utility itemset is an itemset such that its utility is no less than min_utility.

To explain what is a closed itemset it is necessary to review a few definitions.

The support of an itemset is the number of transactions that contain the itemset. For example, the itemset {1, 3, 5} has a support of 2 because it appears in three transactions from the database (t1 and t4). A closed is an itemset X such that there does not exist an itemset Y strictly included in X that has the same support. For example, itemset {1, 3, 5} is a closed itemset.

A closed high utility itemset (CHUI) is a high-utility itemset that is a closed itemset.

For example, if we run CHUD with a minimum utility of 30 we obtain 4 closed high-utility itemsets:

itemsets utility support
{1, 2, 3, 4, 5, 6} 30 1 transaction
{2, 3, 4, 5} 40 2 transactions
{2, 3, 5} 37 3 transactions
{1, 3, 5} 31 2 transactions

If the database is a transaction database from a store, we could interpret these results as all the groups of items bought together that generated a profit of 30 $ or more, and that are maximal sets of items in common for a group of customers.

Input file format

The input file format of CHUD is defined as follows. It is a text file. Each lines represents a transaction. Each line is composed of three sections, as follows.

For example, for the previous example, the input file is defined as follows:

3 5 1 2 4 6:30:1 3 5 10 6 5
3 5 2 4:20:3 3 8 6
3 1 4:8:1 5 2
3 5 1 7:27:6 6 10 5
3 5 2 7:11:2 3 4 2

Consider the first line. It means that the transaction {3, 5, 1, 2, 4, 6} has a total utility of 30 and that items 3, 5, 1, 2, 4 and 6 respectively have a utility of 1, 3, 5, 10, 6 and 5 in this transaction. The following lines follow the same format.

Output file format

The output file format of CHUD is defined as follows. It is a text file, where each line represents a closed high utility itemsets. On each line, the items of the itemset are first listed. Each item is represented by an integer, followed by a single space. After, all the items, the keyword "#SUPPORT:" appears and is followed by the support of the itemset. Then, the keyword #UTIL: " appears and is followed by the utility of the itemset. For example, we show below the output file for this example.

6 4 2 1 5 3 #SUP: 1 #UTIL: 30
4 3 2 5 #SUP: 2 #UTIL: 40
2 5 3 #SUP: 3 #UTIL: 37
1 3 5 #SUP: 2 #UTIL: 31

For example, the third line indicates that the itemset {2, 3, 5} has a support of 3 transactions and a utility of 37$. The other lines follows the same format.

Performance

High utility itemset mining is a more difficult problem than frequent itemset mining. Therefore, high-utility itemset mining algorithms are generally slower than frequent itemset mining algorithms. The CHUD algorithm is the first algorithm for discovering closed high utility itemsets and was first proposed at ICDM 2011 . However, it is not the fastest. An improved version of CHUD named CHUI-Miner (2015) was proposed, which fixes some of the drawbacks of CHUD. Moreover, another algorithm named EFIM-Closed was shown to be faster than CHUD. Both EFIM-Closed and CHUI-Miner are also offered in SPMF.

Important: if this implementation is used for performance comparison, it should be noted that CHUD is not implemented based on the same assumptions as other algorithms provided in SPMF. In particular, CHUD performs quite a lot of disk accesses. It reads an horizontal database, and if the corresponding vertical database does not exist, it transforms the database and writes it to disk before reading it again to perform the data mining task. Moreover, CHUD also saves some intermediary results to a file (candidates HUIs) before reading them from the file to perform the Phase 2 of the algorithm. This is also costly in terms of I/O disk accesses.

Implementation details

This the original implementation of CHUD by P. Fournier-Viger and Cheng-Wei Wu.

Where can I get more information about the CHUD algorithm?

This is the most recent paper describing the CHUD algorithm:

Tseng, V., Wu, C., Fournier-Viger, P., Yu, P. S. (2015). Efficient Algorithms for Mining the Concise and Lossless Representation of Closed+ High Utility Itemsets. IEEE Transactions on Knowledge and Data Engineering (TKDE), 27(3): 726-739

This is the first paper describing the CHUD algorithm:

Wu, C.-W., Fournier-Viger, P., Yu., P. S., Tseng, V. S. (2011). Efficient Mining of a Concise and Lossless Representation of High Utility Itemsets. Proceedings of the 11th IEEE Intern. Conference on Data Mining (ICDM 2011). IEEE CS Press, pp.824-833.

Besides, for a general overview of high utility itemset mining, you may read this survey paper.