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

How should we rank/score our shared links? #1

Open
amite opened this issue Apr 8, 2017 · 0 comments
Open

How should we rank/score our shared links? #1

amite opened this issue Apr 8, 2017 · 0 comments
Labels

Comments

@amite
Copy link
Owner

amite commented Apr 8, 2017

We want to make sure that the best daily content shows up on top anytime someone checks in. The links with the best score will show up on top. This means we have to assign a computed score to each link item that is posted.

So how do we score the best links?

  1. The latest links - sorted by time posted
  2. The most upvoted links - sorted by number of votes accumulated

In effect we can say that links decay over time - they have a certain freshness to them. Adding votes adds to their score but only incrementally.

Worth adding this excerpt:

Effects of gravity (G) and time (T)

Gravity and time have a significant impact on the score of an item. Generally these things hold true:

  • the score decreases as T increases, meaning that older items will get lower and lower scores
  • the score decreases much faster for older items if gravity is increased

For reference I am also adding the ranking algorithm at the heart of Hacker News:

In Python

def calculate_score(votes, item_hour_age, gravity=1.8):
      return (votes - 1) / pow((item_hour_age+2), gravity)

In PHP

function calculate_score($votes, $item_hour_age, $gravity=1.8) {
    return ($votes - 1) / pow(($item_hour_age+2), $gravity);
}

From the excerpt again:

Score = (P-1) / (T+2)^G

where,
P = points of an item (and -1 is to negate submitters vote)
T = time since submission (in hours)
G = Gravity, defaults to 1.8 in news.arc

more on the HN algo here: https://medium.com/hacking-and-gonzo/how-reddit-ranking-algorithms-work-ef111e33d0d9

@amite amite added the question label Apr 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant