Mining High Average-Utility Itemsets in a Transaction Database with Utility Information using the HAUI-Miner Algorithm (SPMF documentation)

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

How to run this example?

What is HAUI-Miner?

HAUI-Miner is an algorithm for discovering high average-utility itemsets (HAUIs) in a transaction database containing utility information. The HAUI-Miner algorithm discovers HAUIs by exploring a set-enumeration tree using a depth-first search. An efficient pruning strategy is also developed to prune unpromising candidates early and thus reduce the search space

What is the input?

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

Items

Transaction utility

Item utilities for this transaction

t1

1 2 3 4 6

32

5 6 6 9 6

t2

2 3 5

16

2 6 8

t3

1 3 4 5

22

10 2 6 4

t4

1 2 3 4 6

28

5 9 6 6 2

t5

1 2 3 4 5

37

15 9 6 3 4

t6

3 4 5

15

8 3 4

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 1, 2, 3, 4 and 6. The amount of money spent for each item is respectively 5 $, 6 $, 6 $, 9 $ and 6 $. The total amount of money spent in this transaction is 5 + 6 + 6 + 9 + 6 = 32 $.

What is the output?

The output of HAUI-Miner is the set of high average-utility itemsets having an average-utility no less than a minAUtility threshold (a positive integer) set by the user. Average utility measure estimates the utility of an itemset by considering its length. It is defined as the sum of the utilities of the itemset in transactions where it appears, divided by the number of items that it contains. For example, the average-utility of {2, 3, 5} in the database is the utility of {2, 3, 5} in t2 plus the utility of {2, 3, 5} in t5, for a total of 16 + 19 = 35, divide by 3, equals 11.6. A high average-utility itemset is an itemset such that its utility is no less than minAUtility. For example, if we run HAUI-Miner with a minimum utility of 24, we obtain 10 high average-utility itemsets.

itemsets

average-utility

{1}

35

{2}

26

{3}

34

{4}

27

{1 2}

24.5

{1 3}

27.5

{1, 4}

29.5

{2, 3}

25

{3, 4}

27.5

{1, 3, 4}

26.3

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 24 $ or more, when divided by the number of items.

Input file format

The input file format of HAUI-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:

1 2 3 4 6:32:5 6 6 9 6
2 3 5:16:2 6 8
1 3 4 5:22:10 2 6 4
1 2 3 4 6:28:5 9 6 6 2
1 2 3 4 5:37:15 9 6 3 4
3 4 5:15:8 3 4

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

Output file format

The output file format of HAUI-Miner is defined as follows. It is a text file, where each line represents a high average-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 " #AUTIL: " appears and is followed by the average utility of the itemset. For example, we show below the output file for this example.

2 #AUTIL: 26.0
2 1 #AUTIL: 24.5
2 3 #AUTIL: 25.0
1 #AUTIL: 35.0
1 4 #AUTIL: 29.5
1 4 3 #AUTIL: 26.333333333333332
1 3 #AUTIL: 27.5
4 #AUTIL: 27.0
4 3 #AUTIL: 27.5
3 #AUTIL: 34.0

For example, the first line indicates that the itemset {2} has an average-utility of 26. The following lines follows the same format.

Implementation details

The version implemented here contains all the optimizations described in the paper proposing HAUI-Miner. Note that the input format is not exactly the same as described in the original article. But it is equivalent.

Performance

The HAUI-Miner algorithm is a fast algorithm for high average utility itemset mining. However, the EHAUPM algorithm is reported to be up to 5 times faster than HAUI-Miner and is also offered in SPMF.

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

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

Jerry Chun-Wei Lin, Ting Li, Philippe Fournier-Viger, Tzung-Pei Hong, Justin Zhan, and Miroslav Voznak. An Efficient Algorithm to Mine High Average-Utility Itemsets[J]. Advanced Engineering Informatics, 2016, 30(2):233-243.

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