ts_shape.eventlog.lambda_rules.backtest
Minimal hit-count backtest for lambda rules.
The first-slice MVP supports "run rule, count hits" only — no
label-matching, no precision/recall. The returned
:class:BacktestResult still carries the full :class:EventLog so the
caller can inspect any individual hit and run their own downstream
analysis (e.g. to_event_log_xes for pm4py, filter_by_pack for
domain-specific drill-down).
Functions
| Name | Description |
|---|---|
run_backtest | Run detector over dataframe and summarize hit counts. |
run_backtest
run_backtest(
detector: LambdaDetector,
dataframe: pd.DataFrame,
*,
objects: Mapping[str, object] | None = None,
qualifiers: Mapping[str, str] | None = None
) -> BacktestResult
Run detector over dataframe and summarize hit counts.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
detector | LambdaDetector | The registered lambda rule. | required |
dataframe | DataFrame | Input frame the rule is evaluated on. | required |
objects | Mapping[str, object] | None | Object bindings passed to the event-log adapter. | None |
qualifiers | Mapping[str, str] | None | Relation qualifier per object type. | None |
Returns
| Name | Type | Description |
|---|---|---|
A | BacktestResult | class:BacktestResult with the hit count, hits per severity and |
BacktestResult | per asset, and the full event log. |