medic / chic-ts-outlierdetect

Time series anomaly detection module
Apache License 2.0
1 stars 1 forks source link

ZeroDivisionError for time signals that have a '0' during residual analysis #9

Open amrdixon opened 2 years ago

amrdixon commented 2 years ago

During the residual analysis, if the signal contained a "0", there is a ZeroDivisionError thrown at:

https://github.com/medic/chic-ts-outlierdetect/blob/e0f68f1a0c2cd330c6a06cacca35975123c13657/ts_outlierdetect/ts_univariate_outlier.py#L80

https://github.com/medic/chic-ts-outlierdetect/blob/e0f68f1a0c2cd330c6a06cacca35975123c13657/ts_outlierdetect/ts_univariate_outlier.py#L85

To approach this issue, we need the following to be true:

  1. These metrics should be assigned a value that shows the metrics are undefined (e.g. None)
  2. We would like the code to still complete the analysis as other metrics can still help guide model analysis.