Module utils

Module utils 

Source
Expand description

Shared statistical utilities for anomaly detection window functions.

Functions§

anomaly_ratio
Compute a non-negative anomaly score ratio with stable zero-denominator semantics.
cast_to_f64
Cast an ArrayRef to Float64. Returns the array as-is if already Float64.
collect_window_values
Collect valid f64 values from a Float64Array within the given range, skipping NULL, NaN, and ±Inf values.
median_f64
Compute median of a mutable slice using O(n) selection algorithm.
percentile_sorted
Compute percentile on a sorted slice using linear interpolation.