【发布时间】:2018-09-15 09:09:09
【问题描述】:
我有来自sklearn.metrics 的classification_report 的结果,然后是print 的报告,它会是这样的:
precision recall f1-score support
1 1.00 0.84 0.91 43
2 0.12 1.00 0.22 1
avg / total 0.98 0.84 0.90 44
现在,问题是如何在 Jupyter 小部件(上述格式)中显示结果并更新其值?
目前,我正在使用html 小部件来显示结果:
#pass test and result vectors
report = classification_report(pred_test , self.y_test_data)
predict_table = widgets.HTML(value = "")
predict_table.value = report
但它喜欢以下内容:
precision recall f1-score support 1 1.00 0.81 0.90 43 2 0.00 0.00 0.00 0 avg / total 1.00 0.81 0.90 43
【问题讨论】:
标签: python-2.7 widget jupyter