View source: R/har_online_session.R
| har_online_session | R Documentation |
Creates and runs a streaming session that reuses existing Harbinger detectors without changing their offline APIs. The session layer is intentionally additive: it orchestrates ingestion, batching, memory management, tracing, and evaluation support around the detector already provided by the package.
The session supports:
pull sources through next_observation()
push ingestion through ingest()
full or bounded memory policies
explicit execution strategies
structured tracing for Detection Probability (DP) and Detection Lag (DL)
har_online_session(
source,
detector,
executor = har_online_refit_full(),
warmup_size = 30,
batch_size = 30,
memory = har_memory_full(),
mode = c("auto", "pull", "push")
)
source |
Streaming source object. May be |
detector |
Any existing Harbinger detector. |
executor |
Execution strategy. Defaults to |
warmup_size |
Number of initial observations consumed before regular streaming detection starts. |
batch_size |
Number of new observations required to trigger one online detection cycle. |
memory |
Memory policy. Defaults to |
mode |
Session mode:
|
A har_online_session object.
source <- har_source_simulated(c(10, 11, 12, 20, 12, 11, 10))
session <- har_online_session(
source = source,
detector = hcp_page_hinkley(min_instances = 3, threshold = 1),
warmup_size = 3,
batch_size = 2
)
session <- daltoolbox::fit(session)
session <- run_online(session)
head(collect_detection(session))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.