def jaccard(x, y): intersect = np.sum(np.sum(np.sum(x * y))) union = np.sum(np.sum(np.sum(x + y))) if union == 0: return 0.0 return intersect / union

将以下代码改为求取Jaccard系数的代码:def dicex y intersect = npsumnpsumnpsumx y y_sum = npsumnpsumnpsumy if y_sum == 0 return 00 x_sum = npsumnpsumnpsumx return 2 intersect x_sum + y_sum

原文地址: https://www.cveoy.top/t/topic/iCOU 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录