Python 排名之间的距离 我有两种方法对字符串列表进行不同的排序,我们可以认为是列表的“正确”排序(即金标准)。
换言之:Python 排名之间的距离 我有两种方法对字符串列表进行不同的排序,我们可以认为是列表的“正确”排序(即金标准)。,python,pandas,scipy,scikit-learn,Python,Pandas,Scipy,Scikit Learn,换言之: ranked_list_of_strings_1 = method_1(list_of_strings) ranked_list_of_strings_2 = method_2(list_of_strings) correctly_ranked_list_of_strings # Some permutation of list_of_strings 考虑到method_1和method_2是黑盒,我如何确定哪种方法更好?在SciPy或scikit-learn或类似的库
ranked_list_of_strings_1 = method_1(list_of_strings)
ranked_list_of_strings_2 = method_2(list_of_strings)
correctly_ranked_list_of_strings # Some permutation of list_of_strings
考虑到method_1
和method_2
是黑盒,我如何确定哪种方法更好?在SciPy
或scikit-learn
或类似的库中,是否有任何方法可以测量这一点
在我的具体案例中,我实际上有一个数据帧,每个方法都输出一个分数。重要的不是方法和真实分数之间的分数差异,而是方法获得了正确的排名(分数越高意味着所有列的排名越高)
您正在寻找标准化贴现累积收益()。这是搜索引擎排名中常用的一个指标,用来测试结果排名的质量 这个想法是,你测试你的排名(在你的情况下,这两种方法)通过点击用户反馈(在你的演员真正的排名)。NDGC将告诉你相对于真实情况的排名质量
Python有一个实现这个度量的模块(如果您想尝试的话,还可以使用其他模块)。还有一个不错的scikit学习库现在似乎也实现了NDCG(和DCG)指标
strings scores_method_1 scores_method_2 true_scores
5714 aeSeOg 0.54 0.1 0.8
5741 NQXACs 0.15 0.3 0.4
5768 zsFZQi 0.57 0.7 0.2