# Algorithm to Get a Product score based on rating

I am trying to device a algo for product score. Here are the inputs

1. User rates a product on 5 different criteria out of 10
2. Each criteria has a different weightage with all adding up to 100%
3. There are 3 types of user expert, inter, beginner
4. Again weightage of users is different

Here is what i have thought

1. We get the final score for each user out of 10 by

User score = CriteriaScore 1 * Weight 1 + CriteriaScore 2 * Weight 2 + ... + CriteriaScore 5 * Weight 5

2. Expert gets a weight of 3, inter get a weight of 2 and beginner gets a weight of 1

Final score = Avg Final score of expert * WeightExpert + Avg Final score of inter * WeightInter + Avg Final score of beginner * WeightBeginner

But my formula doesn't take into account How many people rated the product. How do i get this data into the picure.

Any other suggestion is also welcome

-

## 1 Answer

You want a weighted average computed as follows:

$$\frac{ w_1 S_1 + w_2S_2 + w_3S_3}{w_1C_1 + w_2C_2 + w_3C_3}$$

Where $S_i$ is the sum of the scores from the people with "level" $i$, and $C_i$ is the number of users of "level" $i$. Thus, if level "1", "2", and "3" are, respectively, "expert," "inter," and "beginner," the formula would be:

$$\frac{3S_1 + 2S_2 + S_3}{3C_1+2C_2 + C_3}$$

Think of it this way: An expert's score is submitted three times, intermediate two times, and beginner one time. So the denominator would be the "count" of the total data, and the numerator is the sum of that data set.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5849286317825317, "perplexity": 1470.2603981721495}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-22/segments/1464049281869.96/warc/CC-MAIN-20160524002121-00014-ip-10-185-217-139.ec2.internal.warc.gz"}