def evaluate(self):
t, result = timed(
lambda: self.em.predict(self.hists).reshape(-1),
repeat=1
)
auc = roc_auc_score(self.cats.reshape(-1), result)
acc = accuracy_score(self.cats, result > 0.5)
for i in xrange(result.shape[0]):
print('%d: %.2e' % (self.cats.reshape(-1)[i], result[i]))
print('Time %.2f millisec' % (t * 1000.0))
print('AUC: %.3f' % auc)
return acc, auc
评论列表
文章目录