algorithms (pmrf.algorithms)

General helper algorithms for anomaly and convergence detection.

Functions

get_anomaly_mask(Y, threshold)

Computes a boolean mask of rows that ARE anomalies.

has_sudden_changes(values, *[, upwards, ...])

Checks if an array has any sudden changes for all values relative to the previous window values.

has_converged_by_absolute_tolerance(values, atol)

Returns True if the last window values are all below the absolute tolerance.

has_converged_by_relative_tolerance(values)

Returns True if the relative change between consecutive values is below epsilon for the last window steps.

has_converged_by_patience(values, patience)

Check if an array has converged by no improvement over a recent window.

has_converged(values, *[, rtol, atol, ...])

Check if an array has converged by various metrics.