Comparing tag sets with Jaccard similarity

Jaccard similarity divides intersection size by union size, counting every tag chosen by either side in the denominator.

jaccard_score in practice

Truth is cat and indoor, prediction is cat and pet. One shared tag over three distinct tags gives 1/3. Set a convention for two empty sets.

中文

用 Jaccard 比较两组标签

Jaccard 相似度是交集大小除以并集大小,只要一方使用过的标签就进入分母。

jaccard_score 应用实例

真实标签是猫、室内,预测为猫、宠物,重合一项、并集三项,得分 1/3。两边都为空时要约定评分规则。

References / 参考来源

Keep reading / 继续阅读