To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.
Number of repeats of a trace in a log
Answers
-
Hi,
You can have that functionality from the PatternAbstractions Package. Note that you need to checkout the latest version from the SVN for this.
The required functionality is provided through the following steps and APIs:
1. First create a set of event classes. Let us call this activitySet. The current implementation assumes that the classifier is Activity Name+"-"+Event Type, e.g., Register-start, Repair (Simple)-start etc.,
2. Encode the set of activities generated in step 1 using the following API:
EncodeActivitySet eas = new EncodeActivitySet(activitySet)
this provides several methods, three of which would be required for you
a. eas.getActivityCharMap() -> A hashmap containing the encoding of each activity into a char or a charstream
b. eas.getCharActivityMap() -> A hashmap containing the char/charstream and its corresponding activity
c. eas.getEncodingLength() -> the encoding length for each activity (if the number of distinct activities is beyond 65, then the encoding length would be 2, otherwise, it will be 1)
3. Encode the traces in the log into charstreams using the class EncodeTraces
EncodeTraces et = new EncodeTraces(eas.getActivityCharMapA(), log);
4. You can get the count of how many times a trace repeats using the following API
et.getEncodedTraceCountMap();
This will return a hashmap containing the charstream of a trace and its corresponding count. For e.g,,
abcd, 4 or
a0b0c0d0 4
You can now parse the charStream keys from the map by using the encoding length if you want to get a sequence like you want
For e.g., abcd => (a, b, c, d) (encoding length=1)
a0b0c0d0 => (a0, b0, c0, d0) (encoding length=2);
Hope this helps.
Best,
JC
-
Thanks JC.It worked like you said.
Howdy, Stranger!
Categories
- 1.6K All Categories
- 45 Announcements / News
- 225 Process Mining
- 6 - BPI Challenge 2020
- 9 - BPI Challenge 2019
- 24 - BPI Challenge 2018
- 27 - BPI Challenge 2017
- 8 - BPI Challenge 2016
- 68 Research
- 1K ProM 6
- 394 - Usage
- 288 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame