# New User of the Month Algorithm Questions

**URL:** https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213
**Category:** Support
**Tags:** badges
**Created:** [December 24, 2024, 2:27pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213 "2024-12-24T14:27:33Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 24, 2024, 2:27pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/1 "2024-12-24T14:27:33Z")

</div>

Hello,  
I was a new user on a Discourse forum with 930+ likes at the end of my first month. The holders of new user of the month were two people, one with about 40 likes and the other with 60 likes. I’ve looked at the code provided in an earlier post on this site, and it should not have been possible for this situation to develop the way it did. Looking at just my top likes, I did the math using the values assigned to a like from each trust level and came out with some number like 360 for just my top likes. Then, doing the math for the user with 60 likes, I multiplied that number by three- even if he had been liked by an admin all sixty times, he still would not have been close to 360. What happened here? We both joined within days of each other in the middle of November… what am I not considering? I don’t mean to sound bitter, but it was pretty dissapointing/confusing. So far, no one has been able to give me an answer other than “New user of the month is a scam”. So any information would be helpful, but keep in mind I’ve already seen the code. Thanks!

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 24, 2024, 3:56pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/2 "2024-12-24T15:56:43Z")

</div>

I looked at [the code](https://github.com/discourse/discourse/blob/4ccbf5c5ad5660f6678cb4e224700be33562b5a7/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb#L50). Not only are likes weighted according to seniority, but also the total is divided according to how many distinct accounts liked your posts. It’s a measure of broad popularity, I suppose.

Edit: oops, maybe it’s divided by post number not accounts - see downthread.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 24, 2024, 4:54pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/3 "2024-12-24T16:54:18Z")

</div>

I accounted for that as well, though.  
It’s really weird, it seems.

> [@Ed\_S](#):
>
> distinct accounts liked your posts

So different acounts? Huh. That makes sense… I can’t get the data for that but I still think it’s weird.

Thanks for the help, though!

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [December 25, 2024, 12:10am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/4 "2024-12-25T00:10:15Z")

</div>

Have you looked over Dataexplorer? It is built into core and there maybe a script already for the query.

As for modifying new user of the month not sure what options. You can however in site settings I believe modify weights per TL

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 25, 2024, 12:17am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/5 "2024-12-25T00:17:07Z")

</div>

No, I haven’t. Might try it.  
Thanks!

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [December 25, 2024, 12:22am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/6 "2024-12-25T00:22:59Z")

</div>

This may help to locate custom ones ppl have shared.

> **[Data & reporting](https://meta.discourse.org/c/community-building/data-reporting/148)**
>
> This is the category for everything related to Discourse data and reporting. Here, you can discuss dashboard reports, custom badge queries, data-explorer queries and any other analytic add-ons.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [December 25, 2024, 8:02am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/7 "2024-12-25T08:02:40Z")

</div>

Only admins of a forum can use Date Explorer, so you cannot use it to get data as a user.

You wrote a lot about the total like counts, but you did not mention the post counts. The score calculated from the likes, weighted by the trust level of the user, is divided by the total number of posts you posted:

> <https://github.com/discourse/discourse/blob/4ccbf5c5ad5660f6678cb4e224700be33562b5a7/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb#L65-L65>

So maybe you received more likes but also posted more often than the users who received the badge.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 25, 2024, 12:24pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/8 "2024-12-25T12:24:06Z")

</div>

That explains a lot. Thank!  
(but it doesn’t make a lot of sense. Posting more should be considered contributing to the community and should not detriment the score, in my opinion.)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [December 25, 2024, 1:32pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/9 "2024-12-25T13:32:16Z")

</div>

> [@Turtle](#):
>
> Posting more should be considered contributing to the community and should not detriment the score

What contributes the most to a community? Many posts with few likes due to their lack of appeal, or a handful of posts that capture users’ interest with many likes?

(I’m aware that the use of likes differs from one community to another, some communities typical users don’t see the value of liking a post, or it’s not in their habit, etc…)

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 25, 2024, 1:42pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/10 "2024-12-25T13:42:56Z")

</div>

I agree, mostly I see your point, but I think it’s a different scenario on my forum.  
Most posts rarely get more then one or two likes, and new user of the month doesn’t factor in solutions, which I think could be nice (but I’m not sure whether or not it’s a plugin) or maybe even make the badge not automatic, so moderators or admins have to choose. That would make the badge more tailored for each forum.  
I would say, do you think that having 1.1K likes with 700ish posts and 60ish solutions in two weeks is considered helpful on a forum or having 60ish likes and 40ish posts (in roughly the same amount of time) is considered more “new user of the month” material?  
Happy holidays, by the way!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [December 25, 2024, 3:04pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/11 "2024-12-25T15:04:09Z")

</div>

> [@Turtle](#):
>
> having 1.1K likes with 700ish posts and 60ish solutions in two weeks is considered helpful on a forum or having 60ish likes and 40ish posts (in roughly the same amount of time) is considered more “new user of the month” material?

This is a very good point and I agree with you that the current algorithm might be too simplistic. I think a good first step would be to make the post factor nonlinear like

`SUM(...) / SQRT(5 + COUNT(DISTINCT p.id))::float AS score`

or maybe even

`LN(1 + SUM(CASE ... END)) / (5 + COUNT(DISTINCT p.id))::float AS score`

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 25, 2024, 3:24pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/12 "2024-12-25T15:24:26Z")

</div>

One approach to favour more-liked posts is to take the sum of the squares of the likes, and then divide by number of posts.

I do wonder if my mistaken take might have value: to take into account the number of distinct liking accounts. It might for example help against cliques or voting rings.

In passing, I note my forum only elected 13 winners of a possible 24 new user of the month badges in the past 12 months.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 25, 2024, 6:08pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/13 "2024-12-25T18:08:44Z")

</div>

> [@Ed\_S](#):
>
> I do wonder if my mistaken take might have value: to take into account the number of distinct liking accounts. It might for example help against cliques or voting rings.

Yeah, I agree. That might be a good idea.

> [@RGJ](#):
>
> `SUM(...) / SQRT(5 + COUNT(DISTINCT p.id))::float AS score`
> 
> or maybe even
> 
> `LN(1 + SUM(CASE ... END)) / (5 + COUNT(DISTINCT p.id))::float AS score`

Mind explaining that in English? I could barely understand the new user of the month code haha.

Would someone with a higher trust level mind editing the title to “New User of the Month Algorithm Questions” or something similar? It’s not a bug, evidently. Just a little peculiar.  
Thanks @Moin!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [December 25, 2024, 10:47pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/14 "2024-12-25T22:47:58Z")

</div>

> [@Turtle](#):
>
> Mind explaining that in English?

The “problem” is that the score is (basically)

\text{Score} = \frac{\text{# Likes}}{\text{# Posts}}

That’s something that is probably not the desired situation, as you already noted. If their average number of likes is the same, a large amount of posts should be rated higher than a low amount of posts, .

So in order to “fix” this problem, we should change the function: the denominator of the fraction should _increase less_ if the number of posts gets bigger. We can fix this by applying a function to it. The usual candidates are SQRT and LN since they are increasing but less-than-linear:

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/6/e/f6e4692866c192a75d916cdc8c83ab937c7fa9ab.png)

So by changing the divisor to something that gets large _less quick_ if the amount of posts gets bigger, the score gets _higher_ (after all, dividing by something smaller gives a larger result). Changing the formula to apply SQRT or LN to the divisor gives the desired result ("A large amount of posts should be rated higher than a low amount of posts, if their average number of likes is the same. ")

The second formula tries to avoid the opposite undesired effect: a small number of highly-liked posts should not be able to dominate the score either.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [December 26, 2024, 12:32am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/15 "2024-12-26T00:32:53Z")

</div>

> [@Turtle](#):
>
> That explains a lot. Thank!  
> (but it doesn’t make a lot of sense. Posting more should be considered contributing to the community and should not detriment the score, in my opinion.)

If you are an admin you can goto site settings and change the weight factors to flatten them out

Ie like weight changes per Trust level and even for staff. You can change the weight so no matter tl or if staff. Likes will be weighed equally instead of increasing by position.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 26, 2024, 12:38am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/16 "2024-12-26T00:38:13Z")

</div>

I’m not an admin, but thanks anyway.  
You learn something new every day, it seems 😀

> [@RGJ](#):
>
> The “problem” is that the score is (basically)
> 
> \text{Score} = \frac{\text{# Likes}}{\text{# Posts}}
> 
> Score=# Likes# Posts

Thanks for explaining that! That’s a neat solution. I wish that was a thing for my forum now…

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 26, 2024, 2:25pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/17 "2024-12-26T14:25:22Z")

</div>

> [@Turtle](#):
>
> Posting more should be considered contributing to the community and should not detriment the score, in my opinion.

That is not really true in most cases. In this logic, what will signal if your posts are really useful are exactly the number of likes. If you post a lot, but can’t maintain a high ratio of like / post that shows that you are being chatty, and possible asking questions that you could have searched for.

For example, your questions are already discussed at

> [@Elections: New User of the Month](https://meta.discourse.org/t/elections-new-user-of-the-month/333897/10):
>
> That user had a less than one like per post ratio, while the one who was awarded had a over 2 likes per post ratio. There is also a weighting of who liked and much more. If the badge isn’t working well, please disable it on your site and create a custom one.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [December 26, 2024, 4:30pm UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/18 "2024-12-26T16:30:10Z")

</div>

Alright. I apologize for posting with this question, however I do disagree. Different forums utilize likes differently, and I think the solution @RGJ posted would be helpful in mine. Not all forums are inclined to like every single post, because we are oftentimes only inclined to like something when it lifts us up and agrees with something we’ve said. Being right often isn’t enough to justify a like from most users. I will look at your link, but I did not see it before. I don’t think it was necessary to post with the same opinion as earlier in the discussion which I already replied to. Can we agree to disagree?

> [@Falco](#):
>
> That is not really true in most cases

Think about it, though. If you’re genuinely helpful, then the more you post the better. That’s what I think the badge should be about.  
In the post you linked, you may have been right about the data, but being active in a community isn’t all about numbers. Earlier I said that if I had only posted the right thing once on the right topic then went totally inactive, I could have won the badge. That’s a loophole that’s not okay.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [December 27, 2024, 7:54am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/19 "2024-12-27T07:54:35Z")

</div>

> [@Falco](#):
>
> . If you post a lot, but can’t maintain a high ratio of like / post

Exactly.

So with the current formula a user that created a single post “I give up, this forum is crap” which gets 20 likes will have a higher score than a user that created 60 helpful posts that got 200 likes in total.

That does not seem right (to me).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 26, 2025, 7:55am UTC](https://meta.discourse.org/t/new-user-of-the-month-algorithm-questions/344213/20 "2025-01-26T07:55:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
