PHP/MySQL - “最高评级”算法
所以我只是建立了一个星级评级系统,并尝试提出一种算法来列出“最高评级”的项目。为简单起见,以下是专栏:
item_name
average_rating (a decimal from 1 to 5)
num_votes
我试图确定票数和评级之间的“最佳点”。例如...
- 评分为(4.6 / 20 票)的项目在列表中应高于评分为(5.0 / 2 票)的项目
- 评分为(2.5 / 100 票)的项目应低于评分为(4.5 / 2 票)的项目)
换句话说,num_votes 是“热门”的一个因素。
有人知道一种非常擅长确定这个“最佳位置”的算法吗?
提前致谢。
So I just built a star-rating system and and trying to come up with an algorithm to list the "Top Rated" items. For simplicity, here are the columns:
item_name
average_rating (a decimal from 1 to 5)
num_votes
I'm trying to determine the "sweet spot" between number of votes and rating. For example...
- An item rated (4.6 / 20 votes) should be higher on the list than an item that's (5.0 / 2 votes)
- An item rated (2.5 / 100 votes) should be below an item that's (4.5 / 2 votes)
So in other words, num_votes plays a factor in what's "Top".
Anyone know of an algorithm that is pretty good at determining this "sweet spot"?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是另一种从统计角度来看听起来不错的方法: http://www.thebroth.com/blog/118 /贝叶斯评级
here's another, statistically sound good way: http://www.thebroth.com/blog/118/bayesian-rating
问题是,4.6/20 的评级应比 5.0/2 高多少...
一个想法是不要考虑没有至少 x 票的项目。
另一个想法是用“中等”票来填补。确定最少 10 票。 5.0/2 必须填满 8 个 2.5 的虚拟选票
5.0/2 意味着 2 个 5.0 的选票,加上 8 个 2.5 的选票,您将得到 30/10 -> 3.0 ;)
现在,您必须决定一个项目至少应有多少票。对于已经获得最低票数的,进行直接比较。
The question is, how much higher the 4.6/20 shall be rated than the 5.0/2...
An idea not to take items in consideration that do not have at least x votes.
Another idea is to fill up with "medium" votes. Decide that 10votes shall be the minimum. The 5.0/2 must be filled with 8 virtual votes of 2.5
5.0/2 means 2 votes with 5.0, add 8 with 2.5 you'll get 30/10 -> 3.0 ;)
Now, you have to decide how many votes an item shall at least have. For those that already have the minimum votes, a direct comparation shall be done.
您给每 10 票的权重为 1,那么 20 票的权重为该项目 2。
那么如果该物品的重量为 0,它将比平均值减少 0.5
How about you give each 10 votes a weight of 1 so 20 votes gives the item 2 weight.
Then if the item has 0 weight it will loose 0.5 from the average