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
ofitemsorSequenceDatabasewithonesequence The event stream; elements may be itemsets (simultaneous events).
- window
float Window width \(w\) (time units of
times; event index units by default).- min_frequency
float,optional WINEPI threshold on the fraction of windows containing the episode.
- min_count
int,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_length
int,optional
- datasequence
- Returns:
Examples
>>> ep = mine_episodes(list("abcabcabd"), window=3, min_frequency=0.2) >>> round(float(ep.frequency[ep.index_of("a b")]), 3) 0.545