What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I am trying to test out my wrapper for the API by writing a little test to calculate the score of a user in a particular tag.

I can't seem to make my totals add up to the sites'. This is most likely caused my a bug in my code, but to be sure I want to know exactly how the 'score' of a user is calculated.

Edit: I was hoping to get some hard and fast facts from one of the staff. Do y'all know how you are calculating the score? Is it just upvotes? Does it count votes that were received before a answer was made wiki?

share|improve this question
    
Pretty sure it's just Upvotes - Downvotes. Maybe you can compare against the results here (I don't know much about the API -- is it live data or based on the data dump?). –  Jon Seigel Jun 7 '10 at 2:24
    
I'm going for live numbers. (@Jon) –  jjnguy Jun 7 '10 at 2:29
    
Hmm... okay, then that query I linked to is of no use (although since it's early in the month, the results should be close at least). Maybe you can find a random user on SO with only a couple of questions or answers and work off that data. It would be much harder to correlate against your own account. –  Jon Seigel Jun 7 '10 at 2:37
    
@Jon, good idea. I will be able to test better on someone with far less answers. –  jjnguy Jun 7 '10 at 2:54
add comment

1 Answer

If you read any of this answer, read this:

The formula for the score on the Top Users page looks like "The sum of all values of (upvotes - downvotes) for answers that are not Community Wiki"

The following goes into more detail on how this was decided.


UPDATE

The top users page has been altered at some point. Now it includes negatively rated posts in its calculations.

This was confirmed after seeing it consistently match the value shown on the user profile page's tag listing, which has always included negative values.

To further confirm, I checked Jeff Atwood again, but this time on the much simpler "cosmetic" tag. At the time of examination, Jeff has 3 non-wiki answers to it, at scores of 2, 1, and -39 (that's what happens when you oppose kbd, it seems). His profile confirms this by placing it at -36. Now, under the old formula, this would make his score equal to 3, however, the Top Users list doesn't even list him at all! This thus means the formula was changed to include negative changes, which explains why all positive instances are matched between the profile page and the Top Users.

I'm leaving the below mostly for posterity. You can skip the section now highlighted "OUTDATED".


It does not include Community Wiki posts. It is all based on the current status of the question - votes pre-wiki do not count.

I did a check on bobince on [regex]. His legendary answer only turned CW after a later point. I believed he claimed to get 800 reputation from it, at least. Now, I summed up all of his non-CW answers and got 276. This is equal to his value on the Stats page. So none of the votes on the legendary answer were counted, meaning all 3000+ votes are excluded. Prior to this I did a similar calculation on a random user Rex M. who had 85 score on [sharepoint]. He had 2 CW answers and they too were excluded if you manually tallied the scores.

The "Last 30 Days" only counts votes on answers within the last 30 days. I did this check on myself - I am on the Last 30 Days for SharePoint at 11 score. Within those 30 days I received 3 extra upvotes on my very first answer back in February, but 11 is only the sum of the answers within those 30 days. So answers from longer than 30 days ago are not counted, even if they received votes in that time.

OUTDATED

Hah, I think I may have found what is throwing off your calculations. The upvotes-downvotes is a tricky beast, but I found a sensible enough sample checking Jeff Atwood on Meta and his performance in [duplicates]. For All Time, Jeff has a score of "23" in 10 answers.

His vote totals for all of his answers are 4, 3, 1, 1, 4, 0, 2, 1, 1, -4, 0, 0, 2, 0, and 4. The two highlighted ones are +3/-7 and +6/-2 respectively, so these are questions that are neither pure upvotes nor pure downvotes. If you sum up positive numbers (of which there are 10), you'll get Jeff's score of 23. The +3/-7 entry shows that an entry with a net negative score is completely ignored, including any upvotes. This is not the same behavior shown by the +6/-2 entry, where the downvotes are included.

So combine this with the point made with bobince (votes received before an answer was made wiki do not count), and our formula looks like "The sum of all non-negative values of (upvotes - downvotes) for answers that are not Community Wiki".

For fun, since I confirmed the behavior of pure upvotes with Rex M. (which is technically expected as when downvotes = 0, upvotes > downvotes is true.), I decided to do a check on pure downvotes. Naturally, it is expected to have the same effect, since upvotes is 0 then upvotes < downvotes is true and the answer will be skipped in the score calculation. I picked Marc Gravell's performance in override, which includes a single post that has a score of 0/-1. And his score does skip over it. Rather useless to point out in the long run but I figure no reason not to leave this test out.

ONE LATER WORD

Now that I have a flag on one of my posts, I was able to confirm that a live flag on a post does not impact the tag stats score. Naturally, the accumulation of flags that causes post deletion invalidates the post from being in the running, but live flags are disregarded even if they would bring your post to 0 or negative when calculated. Only the displayed amount matters.

share|improve this answer
1  
Wow, thanks for all of those great tests. If I don't receive any official comments from the staff, I will accept your answer. –  jjnguy Jun 9 '10 at 17:09
    
FYI, this probably deserves the checkmark, but having an official post would be nice. –  jjnguy Aug 10 '10 at 14:21
    
@jjnguy Your checkmark is yours to give. If you really want to be nice, though, instead of accepting this you could edit my post and bring the "The sum of [...]" part to the top and bold it, so that the answer is not hidden in the middle and requires reading. –  Grace Note Aug 10 '10 at 14:31
    
@grace, ug. That's too much work for this morning. When I get some time 'round lunch i will. –  jjnguy Aug 10 '10 at 14:34
    
@jjnguy Thank you much! Actually, I'll just take the part you should write at the top, so that you don't have to think about proper phrasing or anything. –  Grace Note Aug 10 '10 at 14:37
    
@grace, ok, now my questions is: Why couldn't you do that yourself? –  jjnguy Aug 10 '10 at 14:55
1  
@jjnguy The reason I italicized "really" in the "If you really want to be nice" is because my next edit would push me to CW. At least, judging from when I last saw a question convert on the 7th edit. I could've made the edit myself, but I figured that I could at least fire off the request to see if it got some ground and at least attempt an evasion roll. You know, keep this post in the criteria for the very same stats it discusses. Maybe I can get a shiny [discussion] badge myself, some day. –  Grace Note Aug 10 '10 at 15:21
    
Haha, ok. That makes sense. –  jjnguy Aug 10 '10 at 16:33
1  
@grace: does it count the +15 of the provided answer? Or the score is only based on upvote/downvote? –  dynamic Jun 1 '11 at 18:18
    
@yes Only upvotes and downvotes, and only the corresponding score. It has no effect to or from reputation, so things such as votes that give no reputation due to the reputation cap, they still count. –  Grace Note Jun 1 '11 at 18:19
1  
That sux imo... it has no sense to esclude accepted answer –  dynamic Jun 1 '11 at 18:19
    
@grace: just a little question: does the score ignore the daily rep cap? –  dynamic Jun 1 '11 at 23:04
    
@yes123 Score is not derived from reputation, as mentioned in my previous comment, so it is not affected by the reputation cap. –  Grace Note Jun 2 '11 at 15:07
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .