## 1. Introduction

In this tutorial, we’ll study different methods of calculating the overall (star) rating for any product or service.

## 2. Motivation Behind Star Rating System

**Companies use star ratings as a standard benchmark for a comparative product or service evaluation:**

In essence, these ratings not only help companies earn trust from potential customers but also help them improve their local search rankings, and increase their sales.

Said ratings drive purchase decisions. For example, keeping all other factors the same, an average customer is more likely to buy a product with better star ratings.

## 3. Methods To Calculate Star Ratings

Now, let’s ponder over various methods we can use to calculate the star ratings.

### 3.1. Star Rating Using Average

This is the most popular method to derive star ratings. Here, **we calculate the arithmetic average of all the ratings.**

Usually, the ratings are semi-aggregated: for each product, we can see how many users gave it 1 star, 2 stars, and so on up to the highest ranking (most often, 5 stars). For example:

Then, the average star rating can be calculated as follows:

We can see that this is our regular average method where each possible score value is multiplied by the count of its occurrences.

### 3.2. Star Rating Using Weighted Average Method

Let’s move to the method we’ll call a preferential weighted average method.

**In this method, we assign different weights to each reviewer.** Companies usually determine this weight based on several factors such as total purchase value, customer demographics, customer loyalty, etc.

Let’s say is a matrix with the rows denoting the user weights and the columns denoting the star values. We use to store review count. Let’s say the star values are . Further, let array store the user weights. For example, denotes the review count for the rating value and user weight .

We calculate the star rating as follows:

For instance, let possible user weights are . Let’s suppose our is as follows:

In this example, we get an overall star rating of .

**We can see that the star rating is different from the above two methods. This is so because reviews for each star value carry different weights.**

### 3.3. Star Rating Using Machine Learning Based Methods

## 4. Comparison Between Different Star Rating Methods

**The ordinary average is the most frequently used summary**. However, all reviewers have the same weight, irrespective of their relationship with the company. This is a problem because a loyal customer is given the same weight as a first-time user.

Post the classical method, comes the weighted average method. It corrects this shortcoming. However, it’s difficult to assign each user proper weight. Moreover, it’s more complex and requires us to devise an additional tool for determining the weights. So, we need to do extra work that takes more time.

ML-based methods harness all the power of the data. However, **they require a well-curated, heterogeneous, and balanced dataset as well as a lot of computational power.** We can’t use those methods if we don’t have a quality dataset or enough resources to train ML models.

## 5. Conclusion

This article talked about different methods for calculating star ratings for any product or service. The basic average method is the most frequently used but gives all the reviews an equal weight. In the weighted average method, we assign each user a specific weight that is based on user purchase history and loyalty score. **Many companies have now started using machine learning-based methods to calculate star ratings, proving to be more useful than the average-based methods.**