View a multi-dimensional sequence database file with the MD Sequence Database Viewer (SPMF documentation)

Multi-dimensional sequence databases are a type of data taken as input by some algorithms offered in SPMF such as SEQ-DIM and DIM-SEQ .

Put simply, a multi-dimensional sequence database is a set of sequences that are annotated with some attributes (called dimensions)

SPMF offers a tool to view the content of a multi-dimensional sequence database. This tool is called the SPMF MD Sequence Database Viewer.

This page explains how to use this tool with an example.

How to run this example?

If you want to run this example from the graphical interface of SPMF, (1) choose the algorithm "Open_md_sequence_database_with_viewer", (2) choose the ContextMDSequenceNoTime.txt file as input, and then (3) click "run algorithm" .

graph viewer open

What is displayed?

After running the example, the content of the file will be displayed by the tool. The picture below shows the user interface of this viewer.

The window A) show in the picture below is the main window. It displays the multi-dimensional sequence database using a table. The table has four rows in this example. Each row is a multi-dimensional sequence that contains two parts: dimension values (called an MD-pattern) and a sequence.

Take the first row as example. It represents a multi-dimensional sequence
The cell in the first column indicates that the values for the three dimensions of this multi-dimensional sequence are 1, 1 and 1, respectively.
The cell in the second column indicates that the sequence is defined as follows. First, two items 2 and 4 were observed, followed by the item 3, followed by the item 2, and finally followed by the item 1.

The other multi-dimensional sequences follow the same format.

Besides, there are buttons that provides additional features:

graph viewer database graph

What is the input?

The algorithm takes as input a multi-dimensional sequence database, as used by algorithm such SEQ-DIM and DIM-SEQ .

The database used in this example is provided in the text file "ContextMDSequenceNoTime.txt" in the package ca.pfv.spmf.tests of the SPMF distribution.

The input file format is defined as follows. It is a text file where each line represents a multi-dimensional sequence from a sequence database. Each line is separated into two parts: (1) a MD-pattern (values for some dimensions) and (2) a sequence.

For example, this is the content of the example file "ContextMDSequenceNoTime.txt":

1 1 1 -3 2 4 -1 3 -1 2 -1 1 -1 -2
1 2 2 -3 2 6 -1 3 5 -1 6 7 -1 -2
1 2 1 -3 1 8 -1 1 -1 2 -1 6 -1 -2
* 3 3 -3 2 5 -1 3 5 -1 -2

This file contains four MD-sequences (four lines). Each line has 3 dimensions in each MD-Pattern. For example, consider the second line. It represents a MD-sequence where the value for the three dimensions are respectively 1, 2 and 2. Then, the sequence in this MD-Sequence is the itemset {2, 6} followed by the itemset {3, 5}, followed by the itemset {6, 7}.