4

我实现了用于文本分类的 fastText,链接https://github.com/facebookresearch/fastText/blob/master/tutorials/supervised-learning.md 我想知道precision@1 或P@5 是什么意思?我做了一个二进制分类,但我测试了不同的数字,我不明白结果:

haos-mbp:fastText hao$ ./fasttext test trainmodel.bin train.valid 2
N   312
P@2 0.5
R@2 1
Number of examples: 312
haos-mbp:fastText hao$ ./fasttext test trainmodel.bin train.valid 1
N   312
P@1 0.712
R@1 0.712
Number of examples: 312
haos-mbp:fastText hao$ ./fasttext test trainmodel.bin train.valid 3
N   312
P@3 0.333
R@3 1
Number of examples: 312
4

2 回答 2

4

精度是相关结果的数量与程序检索到的结果总数的比率。假设一个文档搜索引擎,检索到 100 个文档,其中 90 个与查询相关,那么精度是 90 / 100 (0.9)。由于我们已经计算了 100 个结果的精度,因此这是 P@100。

而Recall是算法检索到的相关结果与所有相关结果总数的比值。以上面相同的示例,如果相关文档的总数为 110,则召回率为 90 / 110。

简而言之,召回有助于评估信息检索程序在获取相关结果方面的完整性;精度有助于评估结果的准确性。

请在 fasttext 中检查二进制分类,https://github.com/facebookresearch/fastText/issues/93

于 2017-11-09T05:39:48.787 回答
2

精度是正确预测的标签数量与模型预测的标签数量的比率

召回率是正确预测的标签数量与来自验证数据集的实际标签数量之比。

例如:验证数据集中输入的实际标签:A, B, C, F, G

模型输入的预测标签:A, B, C, D

正确预测的标签:A, B, C

精度:3 / 4=0.75

召回:3 / 5=0.6

于 2019-03-14T13:16:48.930 回答