排名算法

发布于 2024-07-29 04:20:02 字数 1341 浏览 5 评论 0 原文

我需要根据用户评分对一些产品进行排序。

假设我们有 3 个产品 {a,b,c},并且我们有用户对此产品的反馈。 哪个用户向我们提供反馈并不重要(如果您熟悉的话,这个问题与相关过滤无关 - 用户兴趣不是这里的情况)

下面的每一行都是用户在尝试比较 3 个产品时的反馈:

< em>a 150 分 - b 0 分(该用户刚刚告诉我们他对 2 个产品 a 和 b 的看法,并且通过比较 a 和 b,他认为如果他给出 150 分点,然后 b 值 0 分)

a 150 分 - c 20 分

c 200 分 - a 10 分(尽管有前一个,但该用户认为 c 优于 a)

a 200 分 - b 40 分 - c 100 分

a 150 分 - b 50 分

a 150 分 - b 20 分

(这些评级只是一个示例,在现实世界中产品和评级的数量比这个大得多)

现在我需要一种算法来根据用户投票查找产品的排名。 在我看来,最好的方法是用相关图来描述这个问题,并将所有产品相互连接起来。

任何形式的帮助或提示表示赞赏。

<强>/**************************************************** **********************************/

你不能只添加点并计算平均值产品的积分,因为它如何获得积分很重要。 假设 ab 得到 800 分 - 那么 ca 得到 10 分,如下所示:

a 200 - b 0

a 200 - b 0

a 200 - b 0

a 200 - b 0

c 10 - a 0 (这意味着 c 比 a 更好)

所以肯定 ab< /strong> 但凭借小 10 分 ca 获得了更好的排名

/******************** ********************************************************** **********/

I need to sort some products base on user ratings.

Suppose we have 3 products {a,b,c} and we have user's feedbacks about this products.
It's not important which user give us feedback (this question is not about correlative filtering if you are familiar with it - user interests is not the case here)

Each of these below lines is feedback from users when they tried to compare the 3 products:

a 150 points - b 0 points (this user just told us what he thinks of 2 products a and b and in comparison of a and b he thought that if he gives a 150 point then b worth 0 points)

a 150 points - c 20 points

c 200 points - a 10 points (despite the previous one this user thinks that c is better that a)

a 200 points - b 40 points - c 100 points

a 150 points - b 50 points

a 150 points - b 20 points

(These ratings are just a sample and in the real world number of products and ratings are much bigger than this)

Now I need an algorithm to find product's rankings based on user votes. In my point of view, the best way is to describe this problem with a correlation graph and connect all the products to each other.

Any kind of help or tips is appreciated.

/********************************************************************************/

You cannot just add the points and calculate the mean of product's points because it's important how it got his points. Suppose a has got 800 points against b - then c get 10 points against a like this:

a 200 - b 0

a 200 - b 0

a 200 - b 0

a 200 - b 0

c 10 - a 0 (this means that c is better than a)

so definitely a is better than b but with a small 10 points c got a better rank from a

/********************************************************************************/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紫罗兰の梦幻 2024-08-05 04:20:02

你面临一些挑战。 添加排名c 0 - b 20,您会得到一个圆圈,其中c << b< 一个< c。

当然,您的订单不仅不是transitif( from a ),它也不是全部(可能有一些元素您无法决定哪个是)更好,因为没有进行任何用户投票,即使通过其他元素,

你得到的是一个断开连接的、定向的 。 ,有限图(使用边的方向来表示哪个元素(节点更好)。

从某个节点开始,您可以找到更好的节点穿过图,也许会找到多个不可比较的解决方案。如果您访问再次开始节点,停止处理该路径。

也许数学中的顺序理论可以帮助您:查找顺序理论,偏序,哈斯图

要使其更实用:

使用二维数组每个元素一行和一列。 在单元格(a,b)中计算评级的总和。 从某个元素 a 开始,遵循所有正连接(>0),直到到达没有正连接的节点或返回到您已经访问过的节点。 这些节点就是您的解决方案。

You have some challenges. Add a ranking c 0 - b 20 and you got a circle, where c < b < a < c.

And of course your order is not only not transitif ( from a < b < c does not follow a < c ), it is also not total (there might be elements you cannot decide which is better because no user voting has been done, even through other elements.

What you get is a disconnected, directed, finite graph. (use the direction of the edges to say which element(node is better).

Starting at a certain node you can find better nodes marching through the graph, maybe finding multiple non comparable solutions. If you visit the starting node again, stop processing that path.

Maybe order theory in math can help you: look for order theory, partial order, Hasse diagram.

To make this more practical:

Use a two dimensional array with a row and a column per element. In the cell(a,b) calculate the sum of the ratings. Starting at a certain element a, follow all positiv (>0) connections, until you either reach a node that has no positiv connections or come back to a node you visited already. These nodes are your solutions.

宛菡 2024-08-05 04:20:02

baysean 评级系统可能是您最好的选择 - 它考虑了投票以及某个项目所拥有的相对票数,以便为其赋予加权分数。

A baysean rating system might be your best bet - it takes into account the votes and the relative number of votes an item has in order to give it a weighted score.

冬天旳寂寞 2024-08-05 04:20:02

我认为你需要联系每个人如何对每个产品投票 - 例如:
第 1 人投票:a 100,b 50,c 0
第 2 人为 a 投了 0 票,为 b 投了 200 票,为 c 投了 80 票

这应该翻译成:
第 1 个人为 a 投了 3 票,为 b 投了 2 票,为 c 投了 -1 票
2 号人为 a 投了 -1 票,为 b 投了 3 票,为 c 投了 2 票

我正在使用的地方:
3 票最高票
2 为第二高
1 为最低
如果他们投了 0 票,则为 -1(表明他们不喜欢/没有考虑该产品)

无论如何我最初的想法

I think you need to relate how each person voted on each product - for instance:
person 1 voted: 100 for a, 50 for b and 0 for c
person 2 voted 0 for a, 200 for b and 80 for c

this should be translated into:
person 1 voted 3 for a, 2 for b and -1 for c
person 2 voted -1 for a, 3 for b and 2 for c

where I'm using:
3 for the highest vote
2 for the second highest
1 for the lowest
AND -1 if they voted 0 (indication that they disliked/did-not-consider the product)

my initial thought on it anyway

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文