为什么在“热度”中使用某些变量?计算?
我最近阅读了一篇关于 Reddit“热门度”公式的博客文章。下面所示的公式似乎是所使用的公式。有几个变量我不明白为什么会选择它们。我计划使用这个公式作为我参与的应用程序的参考,因此我想知道使用这些变量的基础。
2005 年 12 月 8 日 1 日 - 为什么使用这个日期?另外,为什么要使用偏移时间呢?为什么不使用纪元?这是使用任意日期以便它与平台无关吗?
2nd - 45000 - 为什么使用 45000 作为除数?这是一个任意数字还是有特定含义或目的?
t = (time of entry post) - (Dec 8, 2005)
x = upvotes - downvotes
y = {1 if x > 0, 0 if x = 0, -1 if x < 0)
z = {1 if x < 0, otherwise x}
log(z) + (y * t)/45000
I recently read a blog post about the Reddit "hotness" formula. The formula shown below seems to be the one used. There are a couple of variables I don't understand why they would be picked though. I plan on using this formula as a reference for an app I am involved in, so I'd like to know the basis around why these variables were used.
1st Dec 8, 2005 - Why use this date? Also, why use an offset time at all? Why not use epoch? Was this an arbitrary date used so that it is platform independent?
2nd - 45000 - Why use 45000 as a divisor? Is this an arbitrary number or does it have a specific meaning or purpose?
t = (time of entry post) - (Dec 8, 2005)
x = upvotes - downvotes
y = {1 if x > 0, 0 if x = 0, -1 if x < 0)
z = {1 if x < 0, otherwise x}
log(z) + (y * t)/45000
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑这是 Reddit 原始代码的“纪元”日期。这将使其成为一个不错的选择,因为它使 t 变量开始接近于零,这将使函数更加稳定。
这实际上是时间的缩放函数。这个数字越大,年龄对整体方程的影响越小。我怀疑 45000 是经过一些测试后选择的,并发现在给定所选纪元的情况下提供了合理的衰减率。
I suspect this was the "epoch" date for Reddit's original code. This would make it a good choice, as it keeps the
t
variable starting closer to zero, which would keep the functions more stable.This is effectively a scaling function for time. The larger this number, the less effect age has on the overall equation. I suspect 45000 was chosen after some testing and found to provide a reasonable decay rate given the chosen epoch.