📜 ⬆️ ⬇️

Weighted average voting system

Introduction. This article was written by my friend - Semyon Shtorkin, the owner of the Nizhny Novgorod community site for photographers (photo bitter ). So far, unfortunately, it is not on Habré, but I will try to earn an invite for it with this topic :)

Good day. I want to share with a respected habrasoobshchestvom very objective rating system and ratings based on a weighted average with ratings on a five-point scale.


For example, on a project, users publish certain content units in various sections, for example, photos of different genres. The user has the right to put a rating for the photos, while calculating the rating, in general this is the average of all ratings given for the photo. But, as in any multi-user resource, there are more experienced users, whose voice should play a leading role in the ranking, and there are beginners with a weaker voice. It helps the concept of weight of the voice, and the weight should be differentiated by sections.
')
For example, an author who works in the genre of landscape photography has the maximum weight of a voice in this section, but the minimum, say, in the “Nude” section. I had to sweat before there were formulas that more or less objectively describe the weight of the voice. The meaning of the weight of the voice is as follows (hereinafter examples will concern the ratings of works and authors on a photographic site): the author must confirm his competence in a particular section by typing for his work in it as much as possible (on a five-point scale). The most optimal solution turned out to be in which the weight of the voice varies from 0 to 1, more precisely from 0.1 (for beginners). The formula for calculating the weight of the voice looks like this:

Weight = tanh (N / C) * (SUM (m_value * m_weight) / SUM (m_weight)) / 5.0;

where N is the number of estimates put to the author for publications in this section, C is a normalizing constant depending on user activity, the more users give ratings, the greater must be a constant, m_value and m_weight are the value and weight of each specific assessment taking part in calculating the weight of the voice.

The hyperbolic tangent of the relationship of the estimates to the author to the normalizing constant takes into account the activity of the author himself and his interest in him - the more the author publishes works, the more ratings he is given, the more interesting the works, the more ratings he is given. The larger the constant C, the slower tanh () tends to unity, which means that with high user activity, the user will need more effort to achieve maximum voice weight (or close to maximum). When the value of the ratio N / C large 2, tanh (N / C) approaches unity and ceases to affect the weighted average of all estimates.

By the way, if you switch to MySQL, then you can use the arctangent (ATAN), but since it tends not to 1 but to PI / 2, you should make the appropriate correction. It should also be remembered that the arctangent slowly tends to PI / 2, rather than the hyperbolic tangent to 1, so you will have to make an amendment to the constant.

As for the rating of a specific publication, everything is simple - the formula without taking into account the number of ratings will look like this:

Rate = SUM (m_value * m_weight) / SUM (m_weight);

For more than two years of use on a regional photosite, the rating system proved to be a very effective and objective means of evaluating the authors' works. Since ratings with a weight of less than 0.2 are not involved in rating calculations, the clones of rating ratings are excluded, because to achieve such a weight, clones have to work on equal terms with the main users, i.e. publish real work (the theft of work and re-publication is stopped) and collect estimates from advanced users of the resource. The effectiveness of the author’s weight system in one or another section of the site was confirmed when the country's leading photosite praised and borrowed this chip from my project. But, since they had recently moved to a cumulative rating system, they had to limit themselves only to a visual display of consistency.
authors in different genres.

I wish you luck and objectivity on your resources.
Sincerely yours, Semyon Shtorkin.

Source: https://habr.com/ru/post/63664/


All Articles