流行度算法
时间:2020-03-05 18:44:24 来源:igfitidea点击:
在SO 18上,Joel提到了一种算法,该算法将根据物品的年龄和受欢迎程度对其进行排名,并且该算法基于重力。有人可以发布吗?会很可爱,但是实际上任何一种语言(嗯,我不能做LISP)都可以。
解决方案
回答
我的理解是,这大概是另一篇Jeff Atwood帖子中的以下内容
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 < 1, otherwise x} log(z) + (y * t)/45000
回答
替代文字http://www.mt-soft.com.ar/wordpress/wp-content/plugins/wp-o-matic/cache/0ad4d_reddit_cf_algorithm.png