M
M
Mark Ivanych2014-07-30 18:47:32
Programming
Mark Ivanych, 2014-07-30 18:47:32

And again rating! What formula is used to calculate the rating?

Hello, for example:
There is a database with 100,000 books.
Books have the following fields (they need to calculate the rating):
author - if empty , then negatively affects the
publisher rating - if empty , then negatively affects the
picture rating - if empty , then negatively affects the
year rating - if empty , then negatively affects the
visits rating - the more views , the higher the rating
stars - from 0 to 10, the higher the book is rated by the user, the higher the rating
rating - in this field, you must enter a ready-made rating from 0 to 10
It is planned to run a bot once a day that will analyze books based on the above parameters and assign a rating to each book .
Please help with formula.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-07-30
@begemot_sun

Rating as sum of weights:
sum(ki * pi)

S
snowpiercer, 2014-08-09
@snowpiercer

I advise you to store the rating set by users as at least two numbers: total_rating, voters_count
total_rating - total number of points (stars) given by users
voters_count - number of voters
With this method, we can correctly update the average rating.
You can also think about storing the rating as an array of N numbers - the number of users who have given this or that rating, in order to perform more tricky calculations on this data, for example, take into account extreme ratings (too bad and too good) with less weight.
Further, the calculated rating can be multiplied by 1 if the field is filled, and by 0.9 if the field is empty.
visits - here you need to calibrate, so, the book with the highest visits indicator - its rating is multiplied by 1, and the rating of the book with the lowest visits is multiplied by the number K, where 0 <= K < 1
all other books receive a multiplier in the range from K to 1
Something like that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question