by gus_massa · 4y ago · 0 comments
upvotes / age_in_hurs^1.6 * lot_of_penalties
The 1.6 is call gravity and may change from time to time without warning. I'm not even sure that it's the current number. It was 1.6 a long time ago.
The lot_of_penalties are added automatically by the software, or manually by the mods, or indirectly by the users if enough users flag a post
Also, sometimes the mods give a second chance to some post they like and they appear near the bottom of the front page for a short time.
(upvotes / age_in_hurs^1.6) * lot_of_penalties
or is it
(upvotes / (age_in_hurs^1.6 * lot_of_penalties))
https://news.ycombinator.com/item?id=1781013
(= gravity\* 1.8 timebase\* 120 front-threshold\* 1
nourl-factor\* .4 lightweight-factor\* .17 gag-factor\* .1)
(def frontpage-rank (s (o scorefn realscore) (o gravity gravity*))
(* (/ (let base (- (scorefn s) 1)
(if (> base 0) (expt base .8) base))
(expt (/ (+ (item-age s) timebase*) 60) gravity))
(if (no (in s!type 'story 'poll)) .8
(blank s!url) nourl-factor*
(mem 'bury s!keys) .001
(* (contro-factor s)
(if (mem 'gag s!keys)
gag-factor*
(lightweight s)
lightweight-factor*
1)))))
Python: def calculate_score(votes, item_hour_age, gravity=1.8):
return (votes - 1) / pow((item_hour_age+2), gravity) (upvotes / age_in_hurs^1.6) * lot_of_penalties