ElkArte Community

Elk Development => Feature Discussion => Topic started by: Spuds on November 05, 2015, 09:03:06 pm

Title: Like Stats
Post by: Spuds on November 05, 2015, 09:03:06 pm
I've been going through the like stats code that we added to 1.1 as we prep for a B1 release.  I have some questions of "what" do we want to see as output.

First up is the single most liked message tab.

I've changed that to be the 10 most liked messages as it seems more useful to show top (X) vs top (1).  Also any Top 1 whatever, IMO, drives the wrong community behavior.  I'd even go so far as say I think it should be the top 10 shown in some random order, simply since I feel forums should be about community and not be about who's the "best", especially when it comes to likes.

Next up most liked topic tab.

This tab/stats has a unique behavior in that it gets the topic with the highest total count of liked posts within the topic.  This is different than the current interpretation of most liked topic, that being a topic where the first post in the thread has the most likes. 

Again this is a single topic, not the top (X) topics, so my previous comments apply.  My second problem with this approach is that some topics seem live forever, we have all seen topics that at 50 or more pages long.  The same user could simply like every one of his buddies posts in some long thread and bingo get the most liked topic on a site.  So IMO this is a statistic that will get abused.

Possible alternatives.

Also I think this should be a top (X) listing, not a top 1.  There are some other items in whats displayed but I'll try to prevent further confusion about that pending on what we want to do.

Have not even gotten to the other 3 or 4 tabs :'(
Title: Re: Like Stats
Post by: Joshua Dickerson on November 05, 2015, 09:40:35 pm
The topic should be the first message. The first message should be the topic of the discussion.

OT: If I could go back in time, I would change the names of so many things. A topic would be called a discussion. The actual topic would be the current subject of the first message. No message would have subsequent topics. Discussions would contain messages, the same as they do now.
Title: Re: Like Stats
Post by: Eliana Tamerin on November 05, 2015, 10:12:27 pm
Quote from: Spuds – Next up most liked topic tab.

This tab/stats has a unique behavior in that it gets the topic with the highest total count of liked posts within the topic.  This is different than the current interpretation of most liked topic, that being a topic where the first post in the thread has the most likes. 

Again this is a single topic, not the top (X) topics, so my previous comments apply.  My second problem with this approach is that some topics seem live forever, we have all seen topics that at 50 or more pages long.  The same user could simply like every one of his buddies posts in some long thread and bingo get the most liked topic on a site.  So IMO this is a statistic that will get abused.

Possible alternatives.
  • Only count unique likes.  So a topics that has the highest number of unique likers through all the posts in the topic.  This way if the same person likes 50 posts in a topic, it simply counts as 1.
  • Just use the liked total of the first post, which is already unique by definition, and use that value to get the most liked.  This is the value that is shown on the current topic index.
Another alternative: Likes/post ratio? As the topic gets longer, the amount of likes necessary to make it the Most Liked Topic increases. It doesn't have to be 1/1, but making it dependent on topic length could allow new topics to arise and take the crown when longer topics wind up getting boring and unread by all those but a few.
Title: Re: Like Stats
Post by: Joshua Dickerson on November 05, 2015, 10:28:09 pm
Interesting. Can you define the algorithm?
Title: Re: Like Stats
Post by: Eliana Tamerin on November 05, 2015, 11:11:57 pm
I'm not sure if I can define it outright, perhaps you can help me design something worthy of Elkarte?

My initial thought is to compare an average of likes (total topic likes/total topic posts) to the highest liked post in the topic. So that the stats doesn't actually measure the "most liked topic" based on greatest quantity of stats, but on how much the topic overall is liked in comparison to the single most liked post in that topic. That would discards the outliers (500 people suddenly like a post and it propels it to the top for a solid year) and let the topics be compared on a fairer metric.

But average topic likes/highest liked topic post is still going to have the original problem, just less pronounced. So maybe we want the Most Liked (Active) Topic, whether this is overt or not.

Code: [Select]
[ (totalTopicLikes/totalTopicPosts) - (daysSinceLastPost) ] / highestLikedPost

Or what if we penalize topics that reach/breach 1.0 (meaning that they're a single post topic with a ton of likes, or the topic has a crazy group of fans that likes every post religiously). Honestly, I'm not sure what the best way to do this is, maybe a log function? But it would have to be manipulating artificially so that the log function was acting on a number greater than 1, otherwise you start getting the reverse expectation. Or you simply take the original equation, log it by base 10, and take the absolute value, lower is better. Maybe:

Code: [Select]
 abs( log( [(totalTopicLikes/totalTopicPosts) / highestLikedPost] ) )

Honestly, I haven't put a lot of deep thought into any of this, this is just musing on it tonight. I did a few fake number calculations on the side just to see what it would look like, and I think this is a decent naive implementation. Depends on what you're looking for and how fair you want to make it, though.
Title: Re: Like Stats
Post by: ahrasis on November 06, 2015, 01:22:26 am
Quote from: Joshua Dickerson – The topic should be the first message. The first message should be the topic of the discussion.

OT: If I could go back in time, I would change the names of so many things. A topic would be called a discussion. The actual topic would be the current subject of the first message. No message would have subsequent topics. Discussions would contain messages, the same as they do now.

I thought we can always separate a post and create a new topic with it. By the way, that gives some idea too, if we don't have it yet, i.e. extending reply of a topic to new topic but leaving its trail behind at the original topic. What do you all think?

Note: Sorry spuds, a little bit deviated from OP.
Title: Re: Like Stats
Post by: Jorin on November 06, 2015, 01:30:27 am
Quote from: ahrasis – By the way, that gives some idea too, if we don't have it yet, i.e. extending reply of a topic to new topic but leaving its trail behind at the original topic. What do you all think?

Hm, I can't imagine what you mean with "but leaving its trail behind at the original topic". Can you explain it für me again please?  :-[
Title: Re: Like Stats
Post by: ahrasis on November 06, 2015, 01:41:23 am
Sorry @Jorin , but I think we already have that feature. Just now I tested it and we will have a button in the original reply. The new topic will displayed as a quote.
Title: Re: Like Stats
Post by: Jorin on November 06, 2015, 01:52:04 am
Yes, that's happening right now.
Title: Re: Like Stats
Post by: emanuele on November 06, 2015, 02:05:07 am
Most of them were supposed to be "top 10 x", though some lost the other 9 items in the process of converting the queries to subqueries to avoid issues in postgre with "unusual" grouping.
So, yes go for it!

About the number of likes of a topic, yes I see your point, and I guess it makes sense to count just the first message.

Instead, about the "topics that live forever", in 1.0.1 a log of times were added in order to be able to have fine grained statistics about likes, so we could count the most liked topic/message/author in the last "period of time" (e.g. a month), that would make the list more up-to-date with what is going on on the forum. :D

Another thing to consider is move all these stats to the stats page instead of having a top level menu item for them.
Title: Re: Like Stats
Post by: Jorin on November 06, 2015, 02:11:19 am
Quote from: emanuele – Instead, about the "topics that live forever", in 1.0.1 a log of times were added in order to be able to have fine grained statistics about likes, so we could count the most liked topic/message/author in the last "period of time" (e.g. a month), that would make the list more up-to-date with what is going on on the forum. :D

Can we make that an option admins can choose? Or users?

Quote from: emanuele – Another thing to consider is move all these stats to the stats page instead of having a top level menu item for them.

Reorganize the stats page please!  ;)
Title: Re: Like Stats
Post by: emanuele on November 06, 2015, 02:20:31 am
Quote from: Jorin – Reorganize the stats page please!  ;)
How? (In another topic, maybe. ;))
Title: Re: Like Stats
Post by: ahrasis on November 06, 2015, 03:41:19 am
Quote from: emanuele – Another thing to consider is move all these stats to the stats page instead of having a top level menu item for them.
Top ten topics by likes? Ok with me.
Title: Re: Like Stats
Post by: Spuds on November 06, 2015, 09:49:04 am
I have no idea if I'll break postgre with the updated sub queries since I don't have an install for that to test against.  If I break it they will likely have to wait to B2 for a fix, sorry.

Moving this to the stats page sounds like a very good idea as I don't think the feature belongs in the top menu like it is now, I just have some concerns over the behaviors it could produce.  Currently however the "views" are much more detailed than a basic 1 to N listing so would you suggest changing that as well (I'm all for that  O:-) )  I may just clean up what we have now for B1 and save the consolidation for B2.

@Eliana Tamerin thanks for those thoughts on how to best handle this.  I've been struggling with this "award" as well.  Here is another thought.

Code: [Select]
topic likes + (replies ^ (total likes / unique likers))  

1) topic likes = The likes for the opening post of a thread.
2) total likes / unique likers = This is a 1 to almost zero value.  The more likes a thread gets from the same users, the lower the ratio.
3) take the ratio from 2 and use it as a exponential against the total number of replies.  This is kind of a relevancy factor.

Did some hypothetical ratios using the above and it seems to have the proper limiting effect, not perfect of course but seems to prevent complete gigging of the system.
Title: Re: Like Stats
Post by: Eliana Tamerin on November 06, 2015, 01:17:44 pm
@Spuds I like where that formula is going, but I wonder if adding the total # of replies wholesale is going to still allow massive topics to dominate the stats. What about switching the replies and unique likers values?
Title: Re: Like Stats
Post by: Spuds on November 08, 2015, 11:55:56 am
I've done quite a few attempts at this, and currently I've kind of narrowed it down to the following in order to find most liked topics that have more relevance than simple first post likes or total of likes in the thread.

Code: [Select]
num_distinct_likers + (num_distinct_likers / num_messages_liked) + min(num_distinct_likers, (1 / log(total_like_count / (num_replies + 1))))
The quick breakdown is as follows
Code: [Select]
distinct_likers
Should be obvious, the more unique members that like a thread the more popular it should be.

Code: [Select]
num_distinct_likers / num_messages_liked
This rewards threads that generate the distinct likers in fewer posts.  So if a thread generated 20 unique likes in 3 posts vs 20 in 20 posts it would get more weight. 

Code: [Select]
 min(num_distinct_likers, (1 / log(total_like_count / (num_replies + 1))))
This is limited to never add more weight than the the first term above.  The 1 /  log() section rewards threads that generate a total like count in fewer replies.  So again adds weight to threads that have posts with many likes vs threads with many posts with a bunch of single likes.  This term can also be negative, so if you have a thread with a lot more replies than likes it will remove weight.

So not perfect by any means but does seem to have the effect of finding the more meaty threads.
Title: Re: Like Stats
Post by: Eliana Tamerin on November 08, 2015, 12:06:26 pm
@Spuds Yeah, I think that formula works a bit better than either of our first drafts. I like the emphasis on distinct likers, with the other attributes tacked on as tempered bonuses. The logarithmic growth should make it much harder for long-running threads to outdo new ones with similar likes.

And now I'm like totally ready to like stop using the word like, because like it just feels like I'm overdoing it.
Title: Re: Like Stats
Post by: lordrt on November 14, 2015, 05:38:34 pm
Quote from: Eliana Tamerin – And now I'm like totally ready to like stop using the word like, because like it just feels like I'm overdoing it.

Like it totally feels like the 90's, like really.
Title: Re: Like Stats
Post by: ahrasis on November 14, 2015, 11:47:51 pm
Quote from: Eliana Tamerin – And now I'm like totally ready to like stop using the word like, because like it just feels like I'm overdoing it.
LOL...