Mining the Top-K High Average-Utility Itemsets in a Transaction Database using the ETAUIM Algorithm (SPMF documentation)

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

How to run this example?

What is ETAUIM?

ETAUIM is an algorithm for discovering the top-k  high average-utility itemsets (HAUIs) in a transaction database containing utility information. The ETAUIM algorithm discovers HAUIs using a breadth-first search.

What is the input?

ETAUIM takes as input a transaction database with utility information and a parmaeter  (a positive integer) that is the number of patterns to discover . 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 ETAUIM is the set of the top-k  high average-utility itemsets, that is the k itemsets that have the highest average-utility, where k (a positive integer) is set by the user.

The 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 ETAUIM with k = 5, the algorithm returns the top-5 high average-utility itemsets.

itemsets

average-utility

{1}

35

{3}

34

{1 3}

27.5

{1, 4}

29.5

{3, 4}

27.5

If the database is a transaction database from a store, we could interpret these results as all the groups of items bought together that a high profit when divided by the number of items.

Note that in extreme cases, it is possible that a top-k algorithm returns more than k itemsets if many itemsets have exactly the same average-utility and that a top-k algorithm may also return less than k itemsets if k is set to a very large value and the number of possible itemsets is less than the value of k.

Input file format

The input file format of ETAUIM 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 ETAUIM 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.

4 3 #AUTIL: 27.5
1 4 #AUTIL: 29.5
1 3 #AUTIL: 27.5
1 #AUTIL: 35.0
3 #AUTIL: 34.0

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

Implementation details

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

Where can I get more information about the ETAUIM algorithm?

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

Liu, X., Chen, G., Wu, F. et al. Mining top-k high average-utility itemsets based on breadth-first search. Appl Intell 53, 29319–29337 (2023).

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