What is the best algorithm to calculate the most scored item?

前端 未结 5 795
名媛妹妹
名媛妹妹 2020-12-07 15:15

I have an music items that are scored by users between 1 to 5, and I need a formula to get the 5 most scored items.

But obviously an item that get 3.5 average score

相关标签:
5条回答
  • 2020-12-07 15:40

    I am using for my music files following method:

    Rating is measured in percents (0-100) Songs which are not rated get 50% as a gift Every time someone votes for a song its rating is incremented Every time someone votes against the song its rating is decremented If song rating goes higher than MAX which is 100, then MAX is set to current song rating If song rating goes below MIN, then MIN is set to song rating After every voting which changes MIN or MAX I am doing normalization for every song in the list like that:

    NewRating = (CurrentRating - MIN) *100/(MAX -MIN) Then I am setting back MIN to 0, and MAX to 100.

    This method gives equal chance for old and new songs to get the right rating quickly. Also each vote on best and worst song effects others, what I also consider as right thing to do.

    When choosing songs to play (or to vote) I am generating a random number in range of 0-100 and searching for the next song with rating equal or higher than this number.

    Bad songs are going down and chosen rarely, good songs are going up and are chosen more frequently but I am still leaving a chance for even worst song to be played(voted) sometime in the future.

    0 讨论(0)
  • 2020-12-07 15:42

    Weighted voting for 5-star systems with lots of voters

    You can use Bayesian estimates to calculate weighted voting.

    IMDb (Internet Movie Database) uses this calculation to determine its IMDb Top 250. (Note: IMDb uses 10 stars but the formulas are identical using 5 stars).

    The formula for calculating the Top Rated 250 Titles gives a true Bayesian estimate:

    weighted rating (WR) = (v ÷ (v+m)) × R + (m ÷ (v+m)) × C

    where:

    • R = average for the movie (mean) = (Rating)
    • v = number of votes for the movie = (votes)
    • m = minimum votes required to be listed in the Top 250 (currently 3000)
    • C = the mean vote across the whole report (currently 6.9)

    IMDb Reference

    Wikipedia Reference

    0 讨论(0)
  • 2020-12-07 15:50

    A simple way to balance the system is to add a fixed number of hypothetical users (say the count is H) who all vote for the long-term average A of all your pieces. Say that average is 3; then the formula becomes

    Score = (votesCount x votesAverage + H x A) / (votesCount + H)

    Now when votesCount grows, the relative impact of the hypothetical average-voters diminishes.

    You can set H experimentally, or by thinking about it. E.g. if you think that 20 votes is sufficient to establish relatively strong rating, you could set H=5. Say.

    0 讨论(0)
  • 2020-12-07 15:52

    The reddit scoring algorithm is probably the best bet if you really want to do it the right way. It's explained in detail here and at a high level by xkcd author Randall here.

    The problem is it doesn't really work for five-star ratings which is what you're going for. You should be able to generalize reddit's sorting system to use ratings. Heck, it's probably done somewhere already. I'm going to look for it.

    0 讨论(0)
  • 2020-12-07 15:55

    The term for this is bayesian estimate.

    One common example:

    Bayesian rating = (v*R + m*C)/(v+m)
    where:
    R = average rating of song
    v = number of votes for the song
    m = minimum votes required to be listed (ex. 10)
    C = average vote across all songs

    0 讨论(0)
提交回复
热议问题