首页 > 解决方案 > KeyError: Timestamp('2019-12-23 23:59:58.142906')

问题描述

In Facebook/Kats, I get the error below when I run the tutorial kats_202_detection.ipynb https://github.com/facebookresearch/Kats/blob/master/tutorials/kats_202_detection.ipynb

KeyError: Timestamp('2019-12-23 23:59:58.142906')

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
<ipython-input-265-b73347c84449> in <module>
      3 d = MultivariateAnomalyDetector(multi_anomaly_ts, params, training_days=60)
      4 display(params)
----> 5 anomaly_score_df = d.detector()
      6 
      7 d.plot()

~\AppData\Local\Continuum\anaconda3\lib\site-packages\kats\detectors\outlier.py in detector(self)
    300         while fcstTime < self.df.index.max():
    301             # forecast for fcstTime+ 1
--> 302             pred_df = self._generate_forecast(fcstTime)
    303             # calculate anomaly scores
    304             anomaly_scores_t = self._calc_anomaly_scores(pred_df)

标签: timestampkeyerror

解决方案


推荐阅读