Hi Zéphyrin,
Sorry again about the delay.
Here is the answer to how to add the labels.
Let's say that we consider Example #69 of the documentation as you have requested.
To run this example from the source code, we can use
MainTestSequentialPatternMining2_saveToFile.
The output looks like this:
<0> 2 -1 <1> 1 3 -1 #SUP: 3
<0> 2 -1 <1> 1 2 -1 #SUP: 3
<0> 2 -1 <1> 1 -1 #SUP: 4
<0> 1 -1 <1> 1 2 -1 #SUP: 3
<0> 1 2 -1 <1> 1 -1 #SUP: 3
<0> 1 2 3 -1 #SUP: 3
<0> 1 2 -1 #SUP: 4
Now, if you want to show the labels indicating in which sequences these patterns appear, all you need to do is modify the file
AlgoFournierViger08 located in the package
ca.pfv.spmf.algorithms.sequentialpatterns.fournier2008_seqdim so that these lines are uncommented:
// print the list of Pattern IDs that contains this pattern.
if(prefix.getSequencesID() != null){
r.append(" #SID: "
for(Integer id : prefix.getSequencesID()){
r.append(id);
r.append(' ');
}
}
After, you have done this, you can execute the example again, and the labels will be in the output file:
<0> 2 -1 <1> 1 3 -1 #SUP: 3 #SID: 0 1 3
<0> 2 -1 <1> 1 2 -1 #SUP: 3 #SID: 1 2 3
<0> 2 -1 <1> 1 -1 #SUP: 4 #SID: 0 1 2 3
<0> 1 -1 <1> 1 2 -1 #SUP: 3 #SID: 0 1 2
<0> 1 2 -1 <1> 1 -1 #SUP: 3 #SID: 0 1 2
<0> 1 2 3 -1 #SUP: 3 #SID: 0 1 3
<0> 1 2 -1 #SUP: 4 #SID: 0 1 2 3
Here, for example, the first line indicates "#SID: 0 1 3 " which means that the pattern on this line appear in sequence 0, sequence 1 and sequence 3 (because sequences are numbered as 0,1,2,3).
Hope this helps,
Philippe