按用户评分对产品进行排序/排名的公式
我正在尝试为我的产品数据库找到一个合适的排序算法。用户可以使用 0 到 5 的分数(也可以使用 0.5 分数,例如 2.5)为其产品投票。我的表结构目前如下所示:
[ProductID] [Title] ... [NumberOfVotes] [TotalPoints] [FinalScore]
每当用户投票时,我都会使用一个非常简单的公式计算最终得分,例如 (总分/投票数)= 最终得分。
然后我根据 FinalScore 和 NumberOfVotes 对表进行排序。
虽然这有效,但并不完全公平,因为只有 1 票 5 星的产品很容易进入最高排名。
我不太擅长统计或算法来获得公平的产品排名。 我正在寻找一个相对易于实现的公式,它比我现在使用的方法更公平。
这怎么能做到呢?
I'm trying to get a decent sorting algorithm for my products database. Users can vote for their products with using scores from 0 to 5 (.5 scores are also possible like 2.5). My table structure currently looks like this:
[ProductID] [Title] ... [NumberOfVotes] [TotalPoints] [FinalScore]
Whenever a user votes, I'm calculating the finalscore using a very simple formula like
(TotalPoints / NumberOfVotes) = FinalScore.
Then I sort the table on FinalScore and NumberOfVotes.
While this works, it's not exactly fair because a product which has only 1 vote of 5 stars can easily come in top rankings.
I'm not very good at statistics or algorithms to get a fair product ranking.
I'm looking for a relatively easy-to-implement formula that's fairer than the method I'm using now.
How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在这里找到了一篇关于此的很棒的文章,解释了各种选项,包括其优点和缺点:如何不按平均评分排序,但似乎正确的解决方案是这样的......
似乎令人生畏,但该帖子包含伪代码和清晰的解释。
I found a great post about this here that explains the various options, including thier pros and cons: How Not To Sort By Average Rating but it seems that the correct solution is this...
seems daunting, but the post includes pseudocode and a clear explanation.
您可以使用中位数,这通常比原始平均值更好。此外,您可能会考虑不对任何票数少于(例如,五票)的项目进行评分。
You could use median, which is often better a figure than raw average. In addition, you might consider not to give ratings for any item that has less than, say, five votes.