且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何合并有序preferences集合

更新时间:2022-06-24 10:14:12

一个解决方案,看起来优雅,仍然没有什么需要做的是将每个顺序转换成分数从1到0,其中1是第一个(上图)在给定的审阅者的名单和0排名项目是他们最后的(底部项目),并在两者之间取得一个线性缩放分数的所有项目。因此,如果审稿1行列仅有3项,他们会得到的分数为1,0.5该名单,和0那你干脆把平均分每一个项目的生成整理列表。领带可以通过评审数项被打破(这样的项目一致标记为***的3评审会出现较高的比一致被标记为***的2审阅项目等方面的最终名单。)

A solution that seems elegant and still does what it needs to do would be to convert each ordering into a score from 1 to 0, where 1 is the first (top) ranked item in a given reviewer's list and 0 is their last (bottom item) and all items in between get a linearly scaled score. So if reviewer 1 ranks just 3 items, they would get scores for that list of 1, 0.5, and 0. Then you simply take the mean score of every item to generate a collated list. Ties could be broken by the number of "reviews" for an item (so that an item unanimously marked as best by 3 reviewers would appear higher in the final list than an item unanimously marked as best by 2 reviewers, etc.)

您的要求我们的目标是产生一个列表,它是各种有序列表的排序规则。我们可以假设,看每个审阅的观点是相同的权重。肯定是这个简单的算法实现,但往往这样的问题有比较复杂的要求,一旦你深入到他们。

Your requirement "The goal is to produce one list that is the collation of the various ordered lists. We can assume that each reviewer's point of view is equally weighted." is definitely met by this simple algorithm, but often problems like this have a bit more complex requirements once you dig into them.