View compressing sequential patterns with the Visual Pattern Viewer (SPMF documentation)
Compressing sequential patterns are a type of patterns that can be produced by different algorithms offered in SPMF.
This page explains how to visualize the compressing sequential patterns 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 compressing sequential pattern 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_compressing_sequential_patterns" so that the discovered patterns will be opened with the visual pattern viewer.
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:
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:
- Viewing patterns using different layouts (grid, horizontal and vertical layout).
- Sorting patterns by size and measure values.
- Searching and filtering using measure values
- Displaying statistics about the number of patterns found.
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_compressing_sequential_patterns" as algorithm. Then, select a file containing compressing sequential patterns 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 compressing sequential patterns.
The file format is defined as follows. It is a text file, where each line represents an compressing sequential pattern.
On each line, the compressing sequential pattern is first indicated. Then, the keyword "#SUP" appears followed by a real number indicating the contribution of the pattern in the compression. For example, here is a small pattern file:
support vector machin #SUP: 1922.0710148279322
real world #SUP: 598.4753133154009
machin learn #SUP: 514.3586664227769
state art #SUP: 412.9730013575172
high dimension #SUP: 362.7776787300827
reproduc hilbert space #SUP: 359.42939766764175
neural network #SUP: 210.35608129308093
experiment result #SUP: 187.4169747827109
compon analysi #SUP: 176.54417917714454
supervis learn #SUP: 160.87427082075737
support vector #SUP: 148.74911007808987
well known #SUP: 138.22464635269716
hilbert space #SUP: 21.132125171017833
The first line indicates that the compressing sequential pattern is support vector machin followed by the #SUP tag indicating the compression contribution of this pattern. The last two lines shows the compressed size and uncompressed size of the data in the number of bits, the compression ratio and the running times in seconds.