3 ms·
That's close to the current version, but a little out of date. Here's the code running now: (= gravity* 1.8 timebase* 120 front-threshold* 1 nourl-f
by pg 16y ago
That's close to the current version, but a little out of date.
Here's the code running now:
(= 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)))))
- sahillavingia 16y agoFor those who aren't well versed in Arc or Lisp, could someone go through the differences?
- tel 16y agoAppears to be substantially identical to what's outlined in the post. The only changes are in the penalties dealt out by the type of story, inclusion of a url, buried status, gagged status, and the operation of penalties due to the contro(versial?)-factor function. If you're just submitting interesting URLs and worry about them being shunted off the main page by gravity then there are no practical differences.
- pg 16y agoThe gag tag doesn't mean "gagged." It means the post is a gag, in the sense of a joke. Sorry I can't be more transparent about how contro-factor is calculated, incidentally. Its purpose is to recognize flamewars.
- davi 16y agoI'm curious about how you evaluate prospective algorithm changes. Do you roll out a change you think should work and then monitor, or do you have a corpus of e.g. flame wars you test against?
- pg 16y agoThere's a repl on the server, and I test tweaks on the live site.
- techbio 16y agoDo you have a dashboard of some kind to visualize your tests effects? I am curious about the broad kind of insight one could have with such a programmatic access to this community. Perhaps I missed an essay about HN/REPL?
- pypyguy 16y agoAny genius willing to translate this to python?
- zackattack 16y agoI would prefer PHP but seconded
- sstrudeau 16y agoThis is pretty trivial but sure, something like: function calculate_score($votes, $item_hour_age, $gravity=1.8) { return ($votes - 1) / pow(($item_hour_age+2), $gravity); }
- sstrudeau 16y agoThere's a python implementation in the original article: def calculate_score(votes, item_hour_age, gravity=1.8): return (votes - 1) / pow((item_hour_age+2), gravity)
- EGreg 16y agodo you guys take logs of both sides, so you don't have to keep updating the scores of all the previously posted items? I mean, if all that matters is how big the scores are relative to one another, then A > B <=> log A > log B (since A and B are positive). You'll just have to add a G*log(T+2) to the log(P) for new items, which can go on for a very long time. ... T is the time since some arbitrary point. I think I may have just reinvented the way reddit does it :P
- EGreg 16y agoin fact, as someone else said if you then make T = the number of submissions / votes since the beginning, people would be able to post at midnight and it would still have a "fair" chance of being ranked along with the other articles posted at busier times.