View top-k frequent sequential patterns (with leverage) with the Visual Pattern Viewer (SPMF documentation)

Top-k frequent sequential patterns (with leverage) are a type of patterns that can be produced by different algorithms offered in SPMF.

This page explains how to visualize the top-k frequent sequential patterns (with leverage) found by an algorithm using the Visual Pattern Viewer.

How to run this example?

If you want to run this example using the graphical user interface of SPMF, follow these steps.

1) First, select an top-k frequent sequential pattern (with leverage) mining algorithm offered in SPMF. Several algorithms are offered and are described in the documentation of SPMF.

2) Then, in the user interface of SPMF, after selecting an algorithm and setting its input file path, output file path, and parameters, click on the combo-box besides "Open output file using:", and select "Visualize_top-k_frequent_sequential_patterns" so that the discovered patterns will be opened with the visual pattern viewer.

visualize top-k frequent sequential patterns (with leverage)selection

3) Then click on "Run algorithm" to run the algorithm.

After the algorithm terminates, the discovered patterns will be displayed using the Visual Pattern Viewer:

visualize rules viewer

The Visual Pattern Viewer interface is quite intuitive. It displays each pattern with its value for each evaluation measure using a colored bar.

The Visual Pattern Viewer offers several features such as:

Other ways of running the Visual Pattern Viewer

It is also possible to run the Visual Pattern Viewer as an algorithm from the GUI of SPMF..

In this case, in the user interface of SPMF, select "Visualize_top-k_frequent_sequential_patterns" as algorithm. Then, select a file containing top-k frequent sequential patterns (with leverage) as input file. Then, click "run algorithm".

This will display the patterns from the file using the Visual Pattern Viewer.

Besides, it is also possible to call the Visual Pattern Viewer from the command line interface of SPMF using this syntax:

java -jar spmf.jar run ALGORITHM_NAME PATTERN_FILE.TXT in a folder containing spmf.jar and an input file containing a pattern file, here called: PATTERN_FILE.txt.

What is the input file format?

The algorithm takes as input a file containing top-k frequent sequential patterns (with leverage).

The file format is defined as follows. It is a text file, where each line represents an top-k frequent sequential pattern (with leverage).

Each line is a frequent sequential pattern. Each item from a sequential pattern is a postive integer and items from the same itemset within a sequence are separated by single spaces. The value "-1" indicates the end of an itemset. On each line, the sequential pattern is first indicated. Then, the keyword " #SUP: " appears followed by an integer indicating the support of the pattern as a number of sequences.Then, if the leverage measure is used, the keyword " #LEVERAGE: " appears followed by a double indicating the leverage of the pattern. For example, here is a small pattern file:

5 -1 6 -1 3 -1 #SUP: 2 #LEVERAGE: 1.3333333333333335
1 -1 2 -1 3 -1 #SUP: 4 #LEVERAGE: 1.3333333333333335
1 -1 4 -1 3 -1 #SUP: 3 #LEVERAGE: 1.3333333333333333
5 -1 1 -1 6 -1 3 -1 #SUP: 2 #LEVERAGE: 1.25
5 -1 1 -1 6 -1 3 -1 2 -1 #SUP: 2 #LEVERAGE: 1.2

The first line indicates that the frequent sequential pattern (with leverage)consisting of the itemset {5}, followed by the itemset {6}, followed by the itemset (3) has a support of 2 sequences and a leverage equal to 1.33. The next lines follow the same format.