Open an output file containing patterns with the SPMF Pattern Viewer (SPMF documentation)

The SPMF software can be used to run various algorithms that find interesting patterns in data.

These patterns discovered by algorithms are typically saved in an output text file. This text file can be opened with a text editor but also with a tool called the Pattern Viewer, which is provided in the graphical user interface of SPMF.

This tool offers several interesting features for analyzing the patterns found by an algorithm.

This page explain how to use the Pattern Viewer of SPMF.

How to start the Pattern Viewer?

The main windows for running an algorithm in SPMF is shown in the picture below. In that window, we can choose an algorithm (e.g. Apriori), choose an input file (e.g. contextPasquier99.txt), set an output file for saving the results (e.g. test.txt), and set the parameters of the algorithm.

Then, we can click "Run algorithm" to run the selected algorithm.

But also, as shown in the picture below, we can use this window to decide what to do with the output file after the algorithm is run:

Here we have four main options:

If we choose to open the output file with the pattern viewer tool, the Pattern Viewer window will open when we click the "Run algorithm" button to display the output file produced by the selected algorithm::

pattern viewer tool of SPMF

This windows show the patterns discovered as a table but also provide multiple useful features. Here is an overview:

pattern viewer 2

The main functions provided by the Pattern Viewer are displayed in the picture above:

Running the Pattern Viewer as an algorithm from the graphical user interface

There are also other ways to start the Pattern Viewer of SPMF. In particular, the Pattern Viewer can be called just like any other algorithms offered in SPMF.

For example, lets say that we want to view a file patterns40.txt containing the patterns found by an itemset mining algorithm using the Pattern Viewer.

In the graphical user interface of SPMF, we can (1) select the algorithm "Open_text_file_with_pattern_viewer" and (2) set the input file as patterns40.txt and then (3) click the "Run algorithm" button.

pattern viewer tool of spmf

This will open the content of the patterns40.txt file with the Pattern Viewer:

pattern viewer

Starting the Pattern Viewer using the command line interface of SPMF

We can also start the Pattern Viewer using the command line interface of SPMF by running the following commands in the command line, in a folder containing spmf.jar and the file patterns40.txt:

java -jar spmf.jar run Open_text_file_with_pattern_viewer patterns40.txt