def report(self):
"""Return report with metrics on the whole data."""
loss = sklearn.metrics.log_loss(self.labels, self.observations)
acc = sklearn.metrics.accuracy_score(self.labels,
self._text2predictions(self._predictions2text(self.observations)))
try:
auc = sklearn.metrics.roc_auc_score(self.labels, self.observations)
except ValueError:
auc = 0
report = dict()
report['comments'] = len(self.observations)
report['loss'] = loss
report['accuracy'] = acc
report['auc'] = auc
return report
评论列表
文章目录