Reverse Engineering the Hacker News Ranking Algorithm
sangaline.com
sangaline.com
> (= 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)))))
[0]: https://news.ycombinator.com/item?id=1781417I find this to be a particularly interesting question, not because I actually care about the answer, but because it feels like the data should be able to tell us the answer... My main goal was to tease out the ranking algorithm from the data in a simple and elegant fashion. This made it a little more interesting as an endeavor and hopefully makes it a more interesting read as well.
You're right, the details of the algorithm aren't hugely interesting and are generally available. The point here was to use the data to uncover it in a somewhat novel way. Figuring things out can be fun in and of itself, even if the answers are already available.
Example: Flags affect a story's position, but that algorithm doesn't mention flags at all.
it's from 2345 days ago, which is < 7 years and I'm guessing it had a reasonable lifetime after that anyway - how come you're thinking that it's > 7 years old?
And my point wasn't so much about the actual algorithm either, just that sometimes a pinch of Google = a dollop of calculus :)
Maybe if all of us ask him nicely?
Security by obscurity is bad practice if that's your only layer of defense but it certainly doesn't hurt as one of the layers in your onion.
Honestly the argument "there are bad people, we need to worry about them" is getting tired. It was cool when pg was showing off Arc to the community. It felt like we were all discovering something new, and how to build a community together.
A person trying to game the front page could get all kinds of useful info from there. For instance how the flame detector and voting ring detector work and what penalties exist and when they trigger. The ranking algorithm is a lot more than a simple formula.
https://hn.algolia.com/?query=How%20Hacker%20News%20ranking%...
For example: https://medium.com/hacking-and-gonzo/how-hacker-news-ranking...
https://jkchu.com/2016/02/17/designing-and-implementing-a-ra...
I know that this analysis will get less attention than the one from yesterday, but I personally find it far more interesting and hope that it can stand on its own merits. I'll be around to answer any questions that might come up.
mhm, I'm sure that's what really happened
The other bit was just my attempt to explain why users might have flagged the post. User flags were what demoted its rank, and it isn't obvious why people flagged it. There's also the issue that meta posts aren't great for HN in the first place, but those rarely lack for upvotes.
Worth noting with a rep of 500+ HN users are able to downvote comments.
Pareto principle and all.
And you can enable the showdead flag. Warning: The worst crap is [dead] so this version has even more crap.
Anyway, there are from time to time some interesting articles that are unlucky and don't get even a vote, so after reading the front page please go to the newest page and try to find a hidden jewel there.
PS: There are a few alternative unofficial HN UI. They use alternative orders, probably without the official penalties. For example http://www.daemonology.net/hn-daily/ and https://hckrnews.com/
It would be naive to assume that it doesn't happen...
A post will die on it's own if it fails to receive upvotes. If you think something else should be on the front page, you go and upvote something else or leave a comment on the article explaining why it is crappy (comments down-weight an article). If you can't find something else that's better, then move on and stop acting like some gate keeper of worthy content.
If everyone behaved like what you're suggesting, the front page would just be a bland pile of the lowest common denominator content that displeased the fewest number of people.
This is all beside the point that flagging is (no matter what it ought to be) an extra signal that has broader uses than merely spam/rule violating. I could also argue that "off topic", a use mentioned earlier and on the guidelines, is sufficiently broad and subjective that "something I think the HN community would be better off not discussing" fits "off topic". In any case the flagging mechanism is still there. The site does remove flagging privileges if you use it too often, so there is clearly a sense of how flags ought not to be used too often (or else you lose them) but that hardly influences why flags ought to be used.
I can actually think of some other relevant metrics here that I don't think I've seen quantified before. I'll probably play around with this a bit at some point and if the results are interesting then I'll write them up. If I do though then it will most likely be a few months down the line. I've already written twice as many HN meta articles as I was planning on and need to take a little break :-).