Create a workflow using the SPMF Workflow editor (SPMF documentation)
This example explains how to use the workflow editor of SPMF to run multiple algorithms one after the other (a workflow) .
How to run this example?
If you are using the graphical interface of SPMF, (1) choose the "SPMF_workflow_editor" algorithm, (2) click "Run algorithm".
This will open the SPMF workflow editor, which is displayed below:
The workflow editor is divided in the following main areas:
- On the left, the current workflow is displayed (here it is empty).
- On the right, information about the currently selected element from the workflow is presented and can be edited (here empty)
- In the center, two buttons can be used to add an algorithm to the workflow or remove an algorithm.
- At the top, there is a menu that allows to adjust some settings and give access to some useful tools.
- At the very bottom, there is button "Run workflow" to execute the algorithms from a workflow and a console zone that displays messages when an algorithm is run.
How to use the workflow editor?
Using the Workflow Editor is very simple. The best way to explain how it works is to do it with a step-by-step example.
We will consider a scenario where we want to apply two algorithms.
First, we will apply the Eclat algorithm on a text file called "contextPasquier99.txt". This will produce an output file.
Then, we want to open the output file using the SPMF text editor. Let's see how to create a workflow to do this and then how to run it.
The first step is click the "Add an algorithm" button. This will create a new node for an algorithm like this:
Then, on the right, we need to select the algorithm using the combo box, and set its parameters in the table. For example, I will choose the Eclat algorithm and click on the table to set its minsup parameter to 0.8:
Then, as you observe on the left, two orange boxes have appeared that symbolize the input and output of the algorithm.
We can then click on the topmost orange box, which represents the input. Then on the right, we can click on the button "..." to choose the input file, which will be "contextPasquier99.txt" in this example. This file is a file used in many examples of the SPMF documentation.
Then, we could click on the orange box at the bottom, which represents the output of the algorithm to set the output file name. But here we will just keep the default name of "Output.txt".
Now after that, we will add another algorithm to be run after Eclat. We will click again on the“Add an algorithm” button. This will create a new algorithm node in red color in the workflow. Then, we click on the combosbox to select the algorithm "Open_text_file_with_SPMF_text_editor":
We have finished creating this small workflow, which consists of two algorithms.
This workflow will first run the Eclat algorithm and then open the output using the SPMF text editor.
To run the workflow, we now have to click on the "Run workflow" button.
This will run the two algorithms one after the other, and information about the execution will be displayed in the console if there is no error.
That is all for this short example of using the workflow editor.
It is also possible to create more complex workflows using more than two algorithms.
For example,we could create a new workflow using three algorithms like this: