(defn v-rat
[uv dv]
(/ (expt uv 3/2)
(+ uv dv))))
(define nest-weight
[comment]
(/ 1 (+ (nest-level comment)
(/ 3 (nest-level comment)))))
weight::
(+ (/ ak 2)
(v-rat uv dv)
(reduce + (map (fn [c] (* (nest-weight c)
(v-rat (upvotes c) (downvotes c))))
(remove (fn [c] (= user (user c)))
comments))
Where ak is the average karma of the user (only on comments, if possible), uv and dv are upvotes and downvotes respectively, and comments is a list of comments in reply to the comment we're weighing.=====
Abstractly, I'm trying to consider the comment based on both its individual value as well as how much good discussion it generated. I also take into account, plainly, the average past worth of their comments.
This could certainly use some tweaking, but I like the values I've plugged in so far, and it promotes discussion as well as thoughtful contribution, and gives a nod towards users who have high quality comments in the past.
I'd be interested in tweaking it some more if this seems at all a step in the right direction. I think I could use a better heuristic for replies, as well as a more sophisticated v-rat. I also wonder if it would be possible to see which users downvote and upvote, and give those votes more power (technically possible, that is), and also take into account the users who are replying, and to what effect. This would require a lot more testing, and maybe more CPU cycles than PG would like.
I'm not sure taking time into account is a great idea past the first ~10 minutes of submission. For those first ~10 minutes, perhaps weigh the comment solely using the avg karma of the user + some constant. After those first x minutes, rank by the algorithm.