handlers.py 文件源码

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

项目:luckyhorse 作者: alexmbird 项目源码 文件源码
def handleBucketUpdate(self, ind, t):
    '''
    A bucket has ended.  Compare the last prediction to what actially happened.
    '''
    # Compare the prediction to reality
    if self._last_prediction is not None:
      metric = self._hist[-1]
      #print("%s\t%s" % (self._last_prediction, metric))
      if simplifyMet(self._last_prediction) == simplifyMet(metric):
        self.stats['predict_correct'] += 1
      else:
        self.stats['predict_wrong'] += 1

    s = deque( islice(self._hist, 1, None) )
    prediction = self.tree.predict(s, closest=True)
    self._last_prediction = prediction
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号