def _set_scores(self):
anom_scores = {}<EOL>for timestamp, value in self.time_series.items():<EOL><INDENT>anom_scores[timestamp] = <NUM_LIT:0.0><EOL>if self.absolute_threshold_value_upper and value > self.absolute_threshold_value_upper:<EOL><INDENT>anom_scores[timestamp] = value - self.absolute_threshold_value_upper<EOL><DEDENT>if self.absolute_threshold_value_lower and value < self.absolute_threshold_value_lower:<EOL><INDENT>anom_scores[timestamp] = self.absolute_threshold_value_lower - value<EOL><DEDENT><DEDENT>self.anom_scores = TimeSeries(self._denoise_scores(anom_scores))<EOL>
Compute anomaly scores for the time series
This algorithm just takes the diff of threshold with current value as anomaly score