tspy.data_structures.forecasting.AnomalyDetector module

class tspy.data_structures.forecasting.AnomalyDetector.AnomalyDetector(jvm, confidence)

Bases: object

A basic anomaly detector which used in conjunction with a ForecastingModel can identify anomalies

Methods

is_anomaly(forecasting_model, timestamp, value)

check for an anomaly given a forecasting model, a timestamp, and a value

is_anomaly(forecasting_model, timestamp, value)

check for an anomaly given a forecasting model, a timestamp, and a value

Parameters
forecasting_modelForecastingModel

the model against which this request is made

timestampint

the point in time for which the actual value corresponds

valuefloat

the data value under consideration as an anomaly

Returns
bool

true if the value is outside of the bounds identified for the given time using the instance’s confidence level or the value is NaN, otherwise false