Skip to contents

Executes the anomaly detection pipeline across a sequence of batches for multiple detectors. For each batch, it applies the pipe_net function, accumulates detection results, performs coincidence analysis, and optionally incorporates pre-trained models.

Usage

stream(batch_set, arch_params, use_model = NA)

Arguments

batch_set

A list of batches, each element being a named list of ts objects per detector.

arch_params

A list of architecture and configuration parameters. Typically created by config_pipe.

use_model

(Optional) A named list of pre-trained per-detector statistics to initialize ustat. Default is NA, meaning no pretrained model.

Value

A named list containing:

res.net

Final detector-wise detection results.

coinc.lis

List of coincidence analysis results per batch.

model

Final per-detector accumulated statistics (i.e., last ustat).

arch_params

The configuration object used in the run.

lambda_plot

List of plots for \(\lambda_a\) and \(\lambda_c\).

summary

Final per-detector statistical summary as a data.frame.

eta

List of elapsed times (in seconds) for each batch.

Details

This function initializes the pipeline via init_pipe, registers parallel execution with foreach using a SOCK cluster, and iteratively calls pipe_net on each batch.

After processing all batches, it aggregates per-detector statistics, terminates parallel backend, and visualizes lambda trajectories via plot_lambda.

The output model can be reused as use_model for transfer learning.

Examples

if (FALSE) { # \dontrun{
# Assume batch_set and arch_params are prepared
result <- stream(batch_set, arch_params)
result$summary # Show summary statistics
result$model # Save model for reuse
} # }