sequence mining support in R

361 views
Skip to first unread message

asm

unread,
Oct 30, 2014, 5:50:02 AM10/30/14
to rdata...@googlegroups.com
Hello,

I am looking for a solution to mine frequent temporal pattern with constraints. For example, suppose I have the following table:

time  ID   state
1 1 5
2 1 4
2  2 3
3 1 3
3 2 2
4 1 2
4 2 1
5 1  4
5 2  2
...

so one temporal seq for the state of  object(ID) 1 is 5, 4, 3, 2, 1, 4
and the same for object 2 is 3, 2, 1, 2

Of all such patterns, suppose I am interested in the most frequent patterns (subsequence terminating at state 1). In other words what is the most frequent  subsequence   terminating at state 1 for object 1? Similarly for other objects.

Is there any solution in R? I checked arules, arulesSequences, cspade. I do not find any means to specify that I am interested only in temporal pattern and temporal pattern with specific constraint (terminating in 1 in the example here).


Would appreciate any pointer?

Thanks a lot,
asm

Ulan Sametov

unread,
Oct 31, 2014, 11:24:05 AM10/31/14
to rdata...@googlegroups.com
I remember there was an R package called association rules (temporal version exists too).
did you try it?
it's called arules and arulesSequences.

If somebody knows something better please let me know :)

 

четверг, 30 октября 2014 г., 5:50:02 UTC-4 пользователь asm написал:

Yanchang Zhao

unread,
Nov 11, 2014, 3:04:30 PM11/11/14
to rdata...@googlegroups.com
If you want to set constraint to the left or right hand side of rules, you can set lhs and rhs in "appearance" and an example is
> # rules with rhs containing "Survived" only
> rules <- apriori(titanic.raw,
+ parameter = list(minlen=2, supp=0.005, conf=0.8),
+ appearance = list(rhs=c("Survived=No", "Survived=Yes"),
+ default="lhs"),
+ control = list(verbose=F))
See detailed example at http://www.rdatamining.com/examples/association-rules.

Regards
Yanchang
RDataMining.com
Reply all
Reply to author
Forward
0 new messages