The Data Mining Forum                             open-source data mining software data mining conferences Data Science for Social and Behavioral Analytics DSSBA 2022 data science journal
IMPORTANT: This is the old Data Mining forum.
I keep it online so that you can read the old messages.

Please post your new messages in the new forum: https://forum2.philippe-fournier-viger.com/index.php
 
Getting the sequences, containing a pattern
Posted by: Lyubka Sharalieva
Date: June 30, 2014 08:20AM

Hi,

I am using for my Master's thesis the package for finding sequential patterns using SPADE with BitSet. I'm at a point, where I want to retriev the sequences, which contain a specific pattern. I tried to use the BitSet information in Pattern (pattern.getAppearingIn()), but I cannot menage to find the connection between the sequences (e.g. SequenceDatabase) and the pattern.

Can someone help me?

Best,
Lyubka

Options: ReplyQuote
Re: Getting the sequences, containing a pattern
Date: July 01, 2014 06:29AM

Hi,

I will give you the explanation that may be missing.

Each sequences is identified by an ID starting from 0.

So for example, if you have 4 sequences, they will be numbered 0,1,2, 3.

Now, the method pattern.getAppearingIn() returns the list of sequence ID where the patterns appear.

So for example, if you call pattern.getAppearingIn() and it returns a bitset with 0, 1 and 2 set to true, then it means that the pattern appears in the first, second and the third sequence.

Then if you want to get the sequence with a given ID, it is also not very difficult. For example, if you want to get the sequence with ID 0, then you can use the SequenceDatabase object to do getSequences().get(0) which will return the sequence with ID 0.

Hope this helps. Best,

Philippe

Options: ReplyQuote
Re: Getting the sequences, containing a pattern
Posted by: Lyubka
Date: July 02, 2014 03:23AM

Hi Philippe,

thanks for the response!

I already implemented this in my program. It works just the way you described smiling smiley

Best,
Lyubka

Options: ReplyQuote
Re: Getting the sequences, containing a pattern
Date: July 02, 2014 03:43AM

Ok. Glad it works.

Best,

Philippe

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.