Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Ranking Algorithm #2

Open
ahmads opened this issue Jan 29, 2013 · 3 comments
Open

A Ranking Algorithm #2

ahmads opened this issue Jan 29, 2013 · 3 comments

Comments

@ahmads
Copy link

ahmads commented Jan 29, 2013

The current way of ordering the posts (by date or votes) has no way to surface the “hottest” posts; a raking algorithm would help solve that problem and greatly improve the user experience.

@cenrak
Copy link

cenrak commented Jan 29, 2013

There are a couple of ways that I could think of for this:

  1. Average upvotes per day, lets call it AUPD : This value equals to ((Total Number of Upvotes) / (The number of days since the post was published)). Posts with higher AUPD are shown first. There are two ways to calculate AUPD:
    1. On the fly. Once the main page is requested with AUPD, you will have to go through all posts in @posts and order them to AUPD, through calculating AUPD for each post, then sort them. <- Really bad O()
    2. Create a new AUPD column in the DB. The column is updated 1)daily for all posts, by a worker and 2)when a user upvotes a post, for that specific post.
  2. Average upvotes per view = ((Total Number of Upvotes)/(Total post views)). You can get the number of upvotes from post_votes and for the views, you can either have a counter to each post or a Visit model. Visit model would help in cases like number 4.
  3. Average views per day = ((Total views)/(Number of days since the post was published))
  4. You can change per day to per the last X days for 1 and 3. If you have a Visit mode, you can query the visits for the last month.

Lets be real. A hot post means that it's attracting lots of visitors. Moreover, it's getting lots of upvotes. So, I guess the second approach Average upvotes per view would be the one. Kaman, It would be even cooler if it's something like (Average upvotes per views) in the last week = ((Total Upvotes in the past week)/(Total views in the past week))

@KrayemLy
Copy link

you can build many different ways to order the posts
daily or weekly or both & overall ordering

  • order types : (newest,hottest by views , hottest by votes & hottest by replies )

look at stackoverflow options
http://stackoverflow.com/
they have usefully listing ways for the questions
(( http://meta.stackoverflow.com/ ))

@mznmel
Copy link
Owner

mznmel commented Jan 30, 2013

Thanks all for the interesting discussion. I agree with you, a ranking algorithm would make the website much more useful.

I'm planing to implement an algorithm that's very similar to the one that's used by HackerNews. Here's the algorithm with a good discussion: http://news.ycombinator.com/item?id=1781013
It's most likely to be released with the next major version of Progmr, which's due sometime within the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants