News for hackers. Stuff that matters.
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:

    (= 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)))))
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?
Re:How Hacker News ranking algorithm works by tel on Monday October 11, 2010 @06:41PM (#1781593)
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.

Re:How Hacker News ranking algorithm works by pg on Monday October 11, 2010 @10:19PM (#1782058)
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.

Re:How Hacker News ranking algorithm works by davi on Monday October 11, 2010 @10:53PM (#1782127)
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?
Re:How Hacker News ranking algorithm works by pg on Monday October 11, 2010 @10:57PM (#1782138)
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. ;)
Re:How Hacker News ranking algorithm works by EGreg on Tuesday October 12, 2010 @01:46AM (#1782449)
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

Re:How Hacker News ranking algorithm works by EGreg on Tuesday October 12, 2010 @02:03AM (#1782473)
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.