• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle


  • My first thought is to rank items by totalVotes / score. This would prioritize posts that get lots of votes in both directions.

    Example:

    def getControversialScore(upvotes, downvotes):
      return (upvotes + downvotes) / abs(upvotes - downvotes)
    
    getControversialScore(50, 10) # 1.5
    getControversialScore(4, 5) # 9
    getControversialScore(6, 30) # 1.44
    getControversialScore(30, 28) # 29