def _set_scores(self):
anom_scores_ema = self.exp_avg_detector.run()<EOL>anom_scores_deri = self.derivative_detector.run()<EOL>anom_scores = {}<EOL>for timestamp in anom_scores_ema.timestamps:<EOL><INDENT>anom_scores[timestamp] = max(anom_scores_ema[timestamp],<EOL>anom_scores_ema[timestamp] * DEFAULT_DETECTOR_EMA_WEIGHT + anom_scores_deri[timestamp] * (<NUM_LIT:1> - DEFAULT_DETECTOR_EMA_WEIGHT))<EOL>if anom_scores_ema[timestamp] > DEFAULT_DETECTOR_EMA_SIGNIFICANT:<EOL><INDENT>anom_scores[timestamp] = max(anom_scores[timestamp], anom_scores_deri[timestamp])<EOL><DEDENT><DEDENT>self.anom_scores = TimeSeries(self._denoise_scores(anom_scores))<EOL>
Set anomaly scores using a weighted sum.