Re:How Hacker News ranking algorithm works
by pg on Monday October 11, 2010 @05:46PM
(#1781417)
That's close to the current version, but a little out of date.
Here's the code running now:
[ Parent
| on HN ]
Re:How Hacker News ranking algorithm works
by sahillavingia on Monday October 11, 2010 @05:59PM
(#1781448)
For those who aren't well versed in Arc or Lisp, could someone go through the differences?
Appears 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.
The 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.
I'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?
There's a repl on the server, and I test tweaks on the live site.
Re:How Hacker News ranking algorithm works
by techbio on Friday October 29, 2010 @09:11PM
(#1849728)
Do 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?
Re:How Hacker News ranking algorithm works
by pypyguy on Monday October 11, 2010 @09:26PM
(#1781961)
Any genius willing to translate this to python?
Re:How Hacker News ranking algorithm works
by sstrudeau on Monday October 11, 2010 @10:54PM
(#1782130)
There'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)
Re:How Hacker News ranking algorithm works
by zackattack on Monday October 11, 2010 @10:25PM
(#1782073)
I would prefer PHP but seconded
Re:How Hacker News ranking algorithm works
by sstrudeau on Monday October 11, 2010 @10:56PM
(#1782136)
This 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);
}
Re:How Hacker News ranking algorithm works
by mkramlich on Tuesday October 12, 2010 @02:51AM
(#1782550)
it's interested to see such a direction comparison of PHP to Python. PHP is very similar to the Python except with more syntax noise. :) And probably worse docs. And worse namespacing, etc. ;)
do 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
in 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.