Mining Closed High-Utility Itemsets and High Utility Itemset Generators from a transaction database using the HUCI-Miner Algorithm (SPMF documentation)

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

How to run this example?

What is HUCI-Miner?

HUCI-Miner (Sahoo et al., 2015) is an algorithm for simultaneously discovering closed high-utility itemsets and high utility generators in a transaction database containing utility information.

There has been many work on the design of algorithms for high-utility itemset mining. However, a limitation of many high-utility itemset mining algorithms is that they output too many itemsets. As a result, it may be inconvenient for a user to analyze the result of traditional high utility itemset mining algorithms. As a solution, algorithms have been designed to discover different subsets of high utility itemsets such as the high-utility itemsets that are closed and the high utility generators. The concept of closed itemset and generator itemsets were 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 databases, the concept of closed itemset can be understood as any itemset that is the largest set of items bought by a given set of customers. For more details, you may look at the paper about HUCI-Miner. It provides more details about the motivation for mining closed high-utility itemsets and generator high utility generators.

While there are several algorithms for discovering closed high utility itemsets and there are some other algorithms that try to apply the concept of generator in high utility itemset mining, HUCI-Miner is the first to mine both of them simultaneously. This is especially interesting for generating non redundant high utility association rules as a post-processing step. If you want to do this, check the HGB algorithm also offered in SPMF, which is also proposed by Sahoo et al. 2015, and does exactly that (it first find closed and generator high utility itemsets, and then used them to make high utility association rules).

Note that in SPMF, there are also two version of HUCI-Miner that can be used to mine only the closed high utility itemsets and also only the high utility generators. Those are called HUCI_Miner_Closed and HUCI_Miner_Generators, respectively.

What is the input?

HUCI-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 HUCI-Miner is the set of closed high utility itemsets and high utility generators 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 and a high utility generator, 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.

A high utility generator, as defined by Sahoo (2015), is a high utility itemsets that has no subset that is also a high utility itemset and has the same support.

For example, if we run HUCI-Miner 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.

And we can also obtain the following two high utility generators:

itemsets utility support
{2, 5} 31 3 transactions
{2 4} 30 2 transactions

The output of HUCI-Miner also tells us that {2,5} is the generator of the closed itemset {2,3,5} and that {2,4} is the generator of the itemset {2, 3, 4, 5}

Input file format

The input file format of HUCI-Miner is defined as follows. It is a text file. Each line 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 HUCI-Miner is defined as follows. It is a text file, that contains a list of closed high utility itemsets with some high utility generators.

If a line contains "CLOSED:" then, the following line is a closed high utility itemsets. And if a line contains "GENERATOR:", then the following line is a high utility generators.
The line describing a closed high utility itemset or high utility generator first contain the list of items that are contained in the itemset. Each item is represented by an integer, followed by a single space. After, all the items, the keyword "#UTIL:" appears and is followed by the utility of the itemset. Then, the keyword #SUP: " appears and is followed by the utility of the itemset. For example, we show below the output file for this example.

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

It is to be noted that the generators that are related to a closed itemset are listed immediately below the closed itemset.

For example, the two first lines indicates that the itemset {2, 3, 5} has a support of 3 transactions and a utility of 37$. Then the third and fourth lines indicate that {2 5} is a generator of {2,3,5} and has a support of 3 and a utility of 31$. The other lines follows the same format.

Options

Note that in SPMF, there are also two version of HUCI-Miner that can be used to mine only the closed high utility itemsets and also only the high utility generators. Those are offered in the graphical and command line interfaces of SPMF as the algorithms : HUCI_Miner_Closed and HUCI_Miner_Generators, respectively.

If we run HUCI_Miner_Closed, the output is as follows:

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

And if we run HUCI_Miner_Generators, the output is as follows:

2 5 #UTIL: 31 #SUP: 3
2 4 #UTIL: 30 #SUP: 2

There are also examples in the source code of SPMF for how to run HUCI_Miner_Closed and HUCI_Miner_Generators. Those examples are MainTestHUCIMiner_closed_only.java and MainTestHUCIMiner_generator_only.java in the package ca.pfv.spmf.tests.

Performance

This is the original implementation of HUCI_Miner.

Where can I get more information about the HUCI_Miner algorithm?

This is the reference of the article describing the HUCI_Miner algorithm:

Sahoo, Jayakrushna, Das, A., Goswami, A., (2015) An efficient approach for mining association rules from high utility itemsets. Expert Syst. Appl. 42, 5754-5778.

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