spmviz.mining.mine_episodes#

spmviz.mining.mine_episodes(data, window, min_frequency=None, min_count=None, kind='serial', times=None, max_length=None)[source]#

Frequent serial or parallel episodes of one event stream.

Parameters:
datasequence of items or SequenceDatabase with one sequence

The event stream; elements may be itemsets (simultaneous events).

windowfloat

Window width \(w\) (time units of times; event index units by default).

min_frequencyfloat, optional

WINEPI threshold on the fraction of windows containing the episode.

min_countint, optional

MINEPI threshold on the number of minimal occurrences of width below window (serial episodes only). Give one of the two thresholds.

kind{“serial”, “parallel”}
timesarray_like, optional

Timestamps of the elements of data.

max_lengthint, optional
Returns:
EpisodeSet

Examples

>>> ep = mine_episodes(list("abcabcabd"), window=3, min_frequency=0.2)
>>> round(float(ep.frequency[ep.index_of("a b")]), 3)
0.545