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
评论列表
文章目录