Skip to content

Event Sequence Detector - #245

Open
Leokaufi wants to merge 11 commits into
developmentfrom
feat/event-sequence-detector
Open

Event Sequence Detector#245
Leokaufi wants to merge 11 commits into
developmentfrom
feat/event-sequence-detector

Conversation

@Leokaufi

Copy link
Copy Markdown

NewSequenceDetector

Flags EventID sequences that never appeared during training as anomalies.

How it works

The detector slides a fixed-length window (max_sequence_length) over the
stream of EventIDs coming from the ParserSchema.

Phase What happens
Train Every window seen is encoded and stored in the persistency.
Detect A window not found in the persistency is reported as an anomaly.

On a hit, detect() returns True and writes a score, a description and
the offending sequence into the DetectorSchema output.

Design note

Only sequences of the full window length are learned — no shorter
suffixes. A window is checked before it is stored, so a sequence never
matches itself.

viktorbeck98 and others added 5 commits July 21, 2026 09:33
@Leokaufi
Leokaufi requested a review from viktorbeck98 July 28, 2026 08:10

@viktorbeck98 viktorbeck98 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls also add tests, take the other detectors as inspiration and make sure that each function is tested and the expected anomalies are found in the audit test logfile.

Comment thread pyproject.toml Outdated

super().__init__(name=name, buffer_mode=BufferMode.NO_BUF, config=config)
self.config: NewSequenceDetectorConfig
self._window: deque[int] = deque(maxlen=self.config.max_sequence_length)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially the data_buffer was intended to be used for such a case but I am not sure if it fits. It even has a window mode. Pls check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants