Based on user votes ranking algorithms (c): Stack Overflow

Reddit ranking algorithm.

It features, users can vote for, you can vote against it. In other words, in addition to the time factor, as far as the two variables is enough.

However, there are some specific uses of the site, you must consider more factors. World number one programmer community Q & Stack Overflow , is one such site.

You ask questions about programming on it, waiting for someone to answer. Visitors can vote (in favor or against) your question, indicating that the problem is not valuable.

Once someone answers your question, other people can answer vote (in favor or against) on this.

The role of the ranking algorithm is to identify the hot issues within a certain period of time, that is, what issues most concern, has been the most discussed.

On Stack Overflow pages, each question has three digital front, scoring issues are represented, and the number of visits to answer this question. Based on these variables, you can design the algorithm.

Jeff Atwood, one of the founders, who a few years ago, announced over the formula for calculating the ranking score.

Written in php code is this:

The meaning of the algorithm variables are as follows:

(1) Qviews (Views problem)

  

The more visits to a question, on behalf of the interest, the higher the score. This uses the logarithm to the base 10, the intention is that when traffic increases, its score will continue to affect smaller.

(2) Qscore (problem score) and Qanswers (number of answers)

  

First, Qscore (problem score) = favor - against it. If a problem the more well received in ranking should be more forward.

Qanswers represent the number of answers, representing the number of people involved in this issue. The higher the value, the score will be multiplied. It should be noted that, if no one answered, Qanswers is equal to 0, then no matter how high Qscore useless, meaning that no matter how good the problem, someone must answer, otherwise can not enter the hot issues list.

(3) Ascores (answer score)

  

一般来说,"回答"比"问题"更有意义。这一项的得分越高,就代表回答的质量越高。

但是我感觉,简单加总的设计还不够全面。这里有两个问题。首先,一个正确的回答胜过一百个无用的回答,但是,简单加总会导致,1个得分为100的回答与100个得分为1的回答,总得分相同。其次,由于得分会出现负值,因此那些特别差的回答,会拉低正确回答的得分。

(4)Qage(距离问题发表的时间)和Qupdated(距离最后一个回答的时间)

  

改写一下,可以看得更清楚:

  

Qage和Qupdated的单位都是秒。如果一个问题的存在时间越久,或者距离上一次回答的时间越久,Qage和Qupdated的值就相应增大。

也就是说,随着时间流逝,这两个值都会越变越大,导致分母增大,因此总得分会越来越小。

(5)总结

Stack Overflow热点问题的排名,与参与度(Qviews和Qanswers)和质量(Qscore和Ascores)成正比,与时间(Qage和Qupdated)成反比。

(完)

Guess you like

Origin blog.csdn.net/qq_40452317/article/details/90765452