Mining Generators of High-Utility Itemsets from a transaction database with utility information using the GHUI-Miner Algorithm (SPMF documentation)

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

How to run this example?

What is GHUI-Miner?

GHUI-Miner (Fournier-Viger et al., 2014) is an algorithm for discovering generators of high-utility itemsets in a transaction database containing utility information.

There has been quite a huge amount of work on the topic of high-utility itemset mining. A limitation of several high-utility itemset mining algorithms is that they generate too much results. The GHUI-Miner algorithm was designed to discover only the generators of high-utility itemsets. The concept of generator was previously introduced in frequent itemset mining. An itemset is a generator if it has no subset having the same support (frequency) in the database. An itemset is closed if it has no superset having the same support (frequency) in the database. In terms of application to transaction database, the concept of generator can be understood as any itemset that is the smallest set of items bought in common by a given set of customers, while a closed itemset is the maximal set of items. Generators have shown to be more useful than closed or maximal itemsets in the field of pattern mining for various tasks such as classification. The GHUI-Miner algorithm discovers all generators of high-utility itemsets, that is generators that (1) are high-utility itemsets or (2) have a superset that is a high-utility itemset and has the same support.

For more details, see the paper by Fournier-Viger (2014). It provides a lot of details about the motivation for mining generators of high-utility itemsets.

This is the original implementation of GHUI-Miner.

What is the input?

GHUI-Miner 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 GHUI-Miner is the set of generators of 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 high utility generator itemsets, 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 generator, 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, 5} has a support of 2 because it appears in three transactions from the database (t1 and t4). A generator 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, 5} is a generator.

A generator of high-utility itemsets (HUG) is a generator itemset that (1) is a high-utility itemsets or (2) has a superset that is a high-utility itemset and has the same support.

For example, if we run GHUI-Miner with a minimum utility of 30, we obtain 7 generator of high-utility itemsets:

itemsets utility support
{2} 22 3 transactions
{2, 4} 30 2 transactions
{1 5} 24 2 transactions
{6}
5
1 transaction
{4, 5}
18
2 transactions
{1, 4, 5}
20
1 transaction
{1, 2}
15
1 transaction

If the database is a transaction database from a retail store, we could interpret each itemset found as the smallest set of items common to a group of customers that has bought a given high-utility itemset.

Input file format

The input file format of GHUI-Miner 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 GHUI-Miner is defined as follows. It is a text file, where each line represents a generator of high-utility itemset. 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 #SUP: 1 #UTIL: 5
2 #SUP: 3 #UTIL: 22
4 2 #SUP: 2 #UTIL: 30
4 5 #SUP: 2 #UTIL: 18
4 1 5 #SUP: 1 #UTIL: 20
2 1 #SUP: 1 #UTIL: 15
1 5 #SUP: 2 #UTIL: 24

For example, the third line indicates that the itemset {2, 4} has a support of 2 transactions and a utility of 30$. 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 GHUI-Miner algorithm was proposed in 2014 to discover only the high-utility itemsets that are generators. It is generally faster than discovering all high-utility itemsets. Thus, this algorithm can outperform algorithms such as FHM and HUI-Miner, who discover all high-utility itemsets. This implementation of GHUI-Miner relies on the CHUI-Miner algorithm for discovering closed high-utility itemsets (a necessary step to find GHUIs efficiently)

Implementation details

This is the original implementation of GHUI-Miner.

Where can I get more information about the GHUI-Miner algorithm?

This is the reference of the article describing the GHUI-Miner algorithm:

Fournier-Viger, P., Wu, C.W., Tseng, V.S. (2014). Novel Concise Representations of High Utility Itemsets using Generator Patterns. Proc. 10th Intern. Conference on Advanced Data Mining and Applications (ADMA 2014), Springer LNCS 8933, pp. 30-43.

Note that in this article, another algorithm called HUG-Miner is also proposed. It is a different algorithm, which is also offered in SPMF.

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