nupic_anomaly_output.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:deep_heart_hackatho 作者: akshaynathr 项目源码 文件源码
def __init__(self, *args, **kwargs):
        super(NuPICPlotOutput, self).__init__(*args, **kwargs)
        # Turn matplotlib interactive mode on.
        plt.ion()
        self.dates = []
        self.convertedDates = []
        self.value = []
        self.rawValue = []
        self.allValues = []
        self.allRawValues = []
        self.predicted = []
        self.anomalyScore = []
        self.anomalyLikelihood = []
        self.actualLine = None
        self.rawLine = None
        self.predictedLine = None
        self.anomalyScoreLine = None
        self.anomalyLikelihoodLine = None
        self.linesInitialized = False
        self._chartHighlights = []
        fig = plt.figure(figsize=(16, 10))
        gs = gridspec.GridSpec(2, 1, height_ratios=[3,    1])

        self._mainGraph = fig.add_subplot(gs[0, 0])
        plt.title(self.name)
        plt.ylabel('Value')
        plt.xlabel('Date')

        self._anomalyGraph = fig.add_subplot(gs[1])

        plt.ylabel('Percentage')
        plt.xlabel('Date')

        # Maximizes window
        mng = plt.get_current_fig_manager()
        mng.resize(800, 600)

        plt.tight_layout()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号