Incremental Closed High-Utility Itemset Mining in a Database with Utility Information with the IncCHUI Algorithm (SPMF documentation)

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

How to run this example?

What is IncCHUI?

IncCHUI (Dam et al., 2019) is an algorithm for maintaining closed high-utility itemsets in a transaction database containing utility information that is updated incrementally by inserting new transactions. This task called "incremental closed high-utility itemset mining" is a generalization of the task of closed high utility itemset mining, where the database is not assumed to be static.

What is the input?

IncCHUI 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 4 transactions (t1,t2...t4) and 7 items (1, 2, 3, 4, 5, 6, 7). This database is provided in the text file "DB_incremental1.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

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 $.

The IncCHUI algorithm is an incremental algorithm, which means that it can efficiently update the result when new transactions are inserted into the database. In this example, we will consider that a new transaction is inserted into the database, as follows:

t5 3 5 2 7 11 2 3 4 2

This transaction is provided in the file "DB_incremental2.txt" in the package ca.pfv.spmf.tests of the SPMF distribution.

What is the output?

The output of IncCHUI 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 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, consider the initial database containing transactions t1, t2, t3 and t4. In this database, the utility of {1 4} 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. The support of an itemset is the number of transactions that contain the itemset. A closed high utility itemset is a high utility itemset that has no superset having the same support.

For example, if we run IncCHUI with a minimum utility of 30 on the initial database containing t1,t2,t3 and t4, we obtain 4 closed high-utility itemsets:

itemsets support utility
{1 3 5} 2 31
{2 3 4 5} 2 40
{1 2 3 4 5 6} 1 30

If the database is a transaction database from a store, we could interpret these results as groups of items bought together that generated a profit of 30 $ or more.

Now, IncCHUI is an incremental. It is designed to update the set of high-utility itemsets when new transactions are inserted. For example, consider that transaction t5 is now inserted. The results is thus updated as follows, where 4 closed high-utility itemsets are found:

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

Input file format

The input file format of IncCHUI 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 "DB_incremental1.txt" 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

And the input file "DB_incremental2.txt" is defined as follows:

3 5 2 7:11:2 3 4 2

Consider the first line of the file "DB_incremental1.txt". 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 IncCHUI is defined as follows. It is a text file, where each line represents a 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 " #UTIL: " appears and is followed by the utility of the itemset. For example, we show below the output file after all transactions have been processed from both files.

1 3 5 #SUPP: 2 #UTIL: 31.0
2 5 3 #SUPP: 3 #UTIL: 37.0
2 4 5 3 #SUPP: 2 #UTIL: 40.0
6 2 4 1 5 3 #SUPP: 1 #UTIL: 30.0

For example, the first line indicates that the itemset {1, 3, 5} has a utility of 31 and a support of 2. The following lines follows the same format.


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.

Implementation details

The version offered in SPMF is the original implementation of IncCHUI, which was obtained from Github under the GPL license and then integrated in SPMF.

Note that the input format is not exactly the same as described in the article. But it is equivalent.

Note also, that a file "" is provided in the package "ca.pfv.spmf.tests". This file can be used to run experiments such as those provided in the article proposing IncCHUI where a different number of updates is varied on some datasets. This example uses a single file as input and divide it into several parts. Then, the algorithm is incrementally run by processing each part of the file one after the other.

Where can I get more information about the IncCHUI algorithm?

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

Thu-Lan Dam, Heri Ramampiaro, Kjetil Nørvåg, Quang-Huy Duong: Towards efficiently mining closed high utility itemsets from incremental databases. Knowl. Based Syst. 165: 13-29 (2019)

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