xinleizhao / EarthquakeSequential

Sequential data mining for earthquake and possible related factors
0 stars 0 forks source link

Applying AprioriAll algorithm on 2001 >6M earthquake and volcanoes #1

Closed xinleizhao closed 8 years ago

xinleizhao commented 8 years ago

cluster,startdate,type 0,2001-01-19,E 0,2001-03-15,E 0,2001-04-09,E 0,2001-04-13,E 0,2001-06-19,E 0,2001-06-23,E 0,2001-06-23,E 0,2001-06-26,E 0,2001-06-29,E 0,2001-07-04,E 0,2001-07-05,E 0,2001-07-07,E 0,2001-07-24,E 0,2001-09-01,V 0,2001-10-01,V 0,2001-11-24,V 1,2001-01-11,V 1,2001-02-26,E 1,2001-03-23,E 1,2001-03-24,E

xinleizhao commented 8 years ago

https://github.com/bartdag/pymining pymining library can be used

xinleizhao commented 8 years ago

from pymining import seqmining seqs = ('EV','VEVEVEVEVEV','EVEV','EVEVEVEVEVE','E','EVE','EVEVEVE','VEVE','EVEVEVEVEVE') freq_seqs = seqmining.freq_seq_enum(seqs, 5) sorted(freq_seqs)

And result is:

[(('E',), 9), (('E', 'E'), 7), (('E', 'E', 'V'), 5), (('E', 'V'), 8), (('E', 'V', 'E'), 7), (('E', 'V', 'E', 'V'), 5), (('E', 'V', 'V'), 5), (('V',), 8), (('V', 'E'), 7), (('V', 'E', 'E'), 5), (('V', 'E', 'V'), 6), (('V', 'E', 'V', 'E'), 5), (('V', 'V'), 6), (('V', 'V', 'E'), 5)]