Closed xinleizhao closed 8 years ago
https://github.com/bartdag/pymining pymining library can be used
manually generated sequences (will make this to a script later):
cluster 0: EV cluster 1: VEVEVEVEVEV after: EVEV EVEVEVEVEVE E EVE EVEVEVE VEVE EVEVEVEVEVE
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)]