Skip to content

Feat/time dependent config engine#225

Open
viktorbeck98 wants to merge 3 commits into
developmentfrom
feat/time-dependent-config-engine
Open

Feat/time dependent config engine#225
viktorbeck98 wants to merge 3 commits into
developmentfrom
feat/time-dependent-config-engine

Conversation

@viktorbeck98

@viktorbeck98 viktorbeck98 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Task

Description

Adds an opt-in time_dependent mode to the stability classification, making the auto-configuration time-based instead of event-count-based.

  • StabilityClassifier.is_stable() accepts an optional timestamps list and cuts its 4 threshold segments at equal-duration boundaries over the observed time span (via np.searchsorted). Falls back silently to the existing equal-count segmentation on any missing/invalid timestamps — it never raises.
  • SingleStabilityTracker(time_dependent=True) stores per-occurrence timestamps and passes them to classification; flag and timestamps survive msgpack persistence round-trips, legacy snapshots still load.
  • timestamp: float | None = None is threaded through EventPersistency.ingest_eventEventDataStructure.add_data → tracker add_value; dataframe backends accept and ignore it. EventStabilityTracker(time_dependent=...) forwards the flag like expand_value.
  • Default (time_dependent=False, no timestamps) is bit-for-bit identical to current behavior.

⚠️ Note for downstream code: the abstract SingleTracker.add_value / EventDataStructure.add_data signatures gained an optional trailing timestamp parameter — out-of-tree subclasses must accept it.

Design/formulation background lives in the configuration_engine2.0 research repo.

How Has This Been Tested?

  • 17 new tests in tests/test_persistency/test_time_dependent_stability.py: boundary computation (incl. None/NaN/zero-span/mismatch fallbacks), count-vs-time divergence on a burst-then-drip series, persistence round-trip, and end-to-end plumbing through EventPersistency.
  • Full suite: 550 passed (4 pre-existing unrelated warnings).
  • Exercised end-to-end from the consuming notebook on the HDFS loghub dataset with the flag on and off.

Checklist

  • This Pull-Request goes to the development branch.
  • I have successfully run prek locally.
  • I have added tests to cover my changes.
  • I have linked the issue-id to the task-description.
  • I have performed a self-review of my own code.

viktorbeck98 and others added 2 commits July 14, 2026 16:20
Add a time_dependent config that cuts StabilityClassifier segments at
equal-duration boundaries of the observed time span instead of
equal-count boundaries of the change series.

- StabilityClassifier.is_stable gains optional timestamps; boundaries
  via np.searchsorted on equal-duration cuts, count-mode fallback on
  missing/mismatched/non-finite timestamps or zero span (never raises)
- SingleStabilityTracker(time_dependent=...) stores exact per-occurrence
  timestamps; state round-trips via msgpack, legacy snapshots load
- timestamp threaded EventPersistency.ingest_event -> add_data ->
  add_value as optional trailing param; dataframe backends accept+ignore
- EventStabilityTracker(time_dependent=...) forwards via closure factory
  (survives load(), mirroring expand_value)

Default off is bit-for-bit unchanged. 17 new tests; full suite 550 pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@viktorbeck98
viktorbeck98 changed the base branch from main to development July 15, 2026 13:28
Comment thread src/detectmatelibrary/utils/persistency/event_data_structures/base.py Dismissed
Base automatically changed from development to main July 17, 2026 08:44
@thorinaboenke
thorinaboenke changed the base branch from main to development July 20, 2026 06:12
@viktorbeck98
viktorbeck98 requested a review from ipmach July 21, 2026 13:30
@viktorbeck98
viktorbeck98 marked this pull request as ready for review July 21, 2026 13:30
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.

1 participant