This forum is about

Sequential rule mining

Posted by:
**
Munira
**

Date: February 19, 2018 05:21AM

Hello,

I would like to apply sequential rule mining to time series data. My data is one long sequence of events (some of them happen at the same time stamp), and not separated into distinct sequences as described in documentation (http://www.philippe-fournier-viger.com/spmf/CMRules.php)

This is an example from documentation (several sequences):

1 -1 1 2 3 -1 1 3 -1 4 -1 3 6 -1 -2

1 4 -1 3 -1 2 3 -1 1 5 -1 -2

5 6 -1 1 2 -1 4 6 -1 3 -1 2 -1 -2

5 -1 7 -1 1 6 -1 3 -1 2 -1 3 -1 -2

This is an example of what I have (one big sequence):

1 -1 1 2 3 -1 1 3 -1 4 -1 3 6 -1 1 4 -1 3 -1 2 3 -1 1 5 -1 5 6 -1 1 2 -1 4 6 -2

How would you recommend to convert this one sequence to an input of sequential rule mining algorithms?

Thank you in advance,

Munira

I would like to apply sequential rule mining to time series data. My data is one long sequence of events (some of them happen at the same time stamp), and not separated into distinct sequences as described in documentation (http://www.philippe-fournier-viger.com/spmf/CMRules.php)

This is an example from documentation (several sequences):

1 -1 1 2 3 -1 1 3 -1 4 -1 3 6 -1 -2

1 4 -1 3 -1 2 3 -1 1 5 -1 -2

5 6 -1 1 2 -1 4 6 -1 3 -1 2 -1 -2

5 -1 7 -1 1 6 -1 3 -1 2 -1 3 -1 -2

This is an example of what I have (one big sequence):

1 -1 1 2 3 -1 1 3 -1 4 -1 3 6 -1 1 4 -1 3 -1 2 3 -1 1 5 -1 5 6 -1 1 2 -1 4 6 -2

How would you recommend to convert this one sequence to an input of sequential rule mining algorithms?

Thank you in advance,

Munira

Posted by:
**
webmasterphilfv
**

Date: February 19, 2018 06:22AM

Hi,

There are many different ways of spiting a time series to obtain multiple sequences.

1) A simple way is to split the time series into some segments having the same lengths. For example, each sequence could be a day, a week or a month of data.

In SPMF, there is a tool to split a time series into several segments, and a tool to convert a time series to a sequence. However, these tools do not consider time stamps. They just split by the number of points in each segments.

2) Another possibility would be to use a sliding window. For a window of 5 events, you would first take the events 1,2,3,4,5. Then the next window would be the events 2,3,4,5,6. Then the next windows would be the events 3,4,5,6,7. And so on.. This is another way of processing a sequence.

3) Another possibility could be to use some algorithms designed to find patterns in a single sequence. In SPMF, there is no such algorithm but this type of algorithms do exist. A sequential rule in a single sequence is sometimes called an "episode rules" and there exists some algorithms to find such rules. These algorithm will typically use a sliding window. If you are curious you can have a look. However, I do not have the code for this. Thus, the most simple would be to try 1) or 2) first.

Best regards,

There are many different ways of spiting a time series to obtain multiple sequences.

1) A simple way is to split the time series into some segments having the same lengths. For example, each sequence could be a day, a week or a month of data.

In SPMF, there is a tool to split a time series into several segments, and a tool to convert a time series to a sequence. However, these tools do not consider time stamps. They just split by the number of points in each segments.

2) Another possibility would be to use a sliding window. For a window of 5 events, you would first take the events 1,2,3,4,5. Then the next window would be the events 2,3,4,5,6. Then the next windows would be the events 3,4,5,6,7. And so on.. This is another way of processing a sequence.

3) Another possibility could be to use some algorithms designed to find patterns in a single sequence. In SPMF, there is no such algorithm but this type of algorithms do exist. A sequential rule in a single sequence is sometimes called an "episode rules" and there exists some algorithms to find such rules. These algorithm will typically use a sliding window. If you are curious you can have a look. However, I do not have the code for this. Thus, the most simple would be to try 1) or 2) first.

Best regards,

Posted by:
**
Munira
**

Date: February 19, 2018 06:38AM

Dear **webmasterphilfv**,

Thank you very much for the quick reply and for the library!

Indeed, the 2nd option would be the most appropriate.

Best regards,

Munira

Thank you very much for the quick reply and for the library!

Indeed, the 2nd option would be the most appropriate.

Best regards,

Munira

Posted by:
**
webmasterphilfv
**

Date: February 19, 2018 06:58AM

You are welcome. I am glad that the library is useful. The reason why I have started this library is to share code to help other researchers so that everyone can avoid always programming the same algorithms over and over again. :-)

Best regards,

Philippe

Best regards,

Philippe

Posted by:
**
Lvane
**

Date: March 31, 2018 06:38AM

i think it is somehow like a stream data mining?

Posted by:
**
webmasterphilfv
**

Date: April 07, 2018 09:46PM

Hello

Stream means that the data is always coming, at fast speed and that the stream is never ending.

Thus typical algorithm for mining patterns in stream cannot store the stream, and must only read data from the stream once. This is actually quite challenging.

Many algorithms for stream mining will use some sliding window.

Best,

Stream means that the data is always coming, at fast speed and that the stream is never ending.

Thus typical algorithm for mining patterns in stream cannot store the stream, and must only read data from the stream once. This is actually quite challenging.

Many algorithms for stream mining will use some sliding window.

Best,

Posted by:
**
Hicham
**

Date: April 21, 2018 07:46AM

I want to mine sequential rules in a Stream. Please give me the code this week for my thesis report.

Posted by:
**
webmasterphilfv
**

Date: April 21, 2018 09:38PM

It is an interesting idea. But I cannot do that for you! You should try to do the programming by yourself. You could check the papers about stream mining to see the techniques used for stream mining and then develop your own solution. But this will likely take more than one week. Good luck!