Sequence databases and patterns#
Sequence databases, sequential patterns and containment.
A sequence is an ordered list of non-empty itemsets (elements); most event
logs have exactly one item per element. A pattern has the same structure and
is written as a tuple of tuples: (("a",), ("b", "c")) is the pattern
\(\langle a\,(bc)\rangle\). Every public function of the package also
accepts patterns as strings ("a b c", "a (b c)", "a -> b") or lists.
SequenceDatabase, pattern parsing and formatting, containment under gap, span and time constraints.
Classes#
|
Gap and span constraints of an occurrence. |
|
A database of sequences of itemsets with optional timestamps and attributes. |
Functions#
|
Normalize a pattern given as tuple of tuples, list or string. |
|
Whether a sequence contains a pattern under the given constraints. |
|
Element indices of the earliest-ending occurrence of a pattern, or |
|
Format a pattern as text. |
|
Whether pattern |
|
Sort key giving a total order over mixed items: numbers first, then strings. |
The pattern with its last item removed (the empty tuple for single items). |
|
Items of a pattern in order of appearance (with repetitions). |
|
Number of items of a pattern. |