Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title Bayescore
emoji 🚀
colorFrom pink
colorTo blue
sdk gradio
sdk_version 5.49.0
app_file app.py
pinned false
short_description Bayesian approach to review sorting for Places API

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference Star_Ratings_XKCD

Outline

Approach inspired by Bayesian probability is to have an initial belief about the 'true' rating of an item, and use user ratings to update this belief, meaning we will have to quantify an initial rating for each item (using a 5 point scale, as most review systems do).

As such, we require 2 parameters:

  • The 'true' default rating of an item, if there are no existing ratings 'R' -> the initial belief

  • The weight that we want to give this initial belief, versus subsequent ratings 'W' -> the weight of our initial belief, where belief 'R' is worth W user ratings

Examples

Assume you have W ratings of value R along with any user ratings, and find the average. Given R=2 and W=3, where N is number of user ratings, V is their average

Weighted_Rating = (R*W + N*V) / (W+N)

  1. For 100 user ratings of 4
  • Weighted_Rating = (2 ⋅ 3 + 100 ⋅ 4) / (100 + 3) = 3.94☆
  • In comparison, a straight average would give us a 4☆ rating.
  1. For 3 ratings of 5 and 1 rating of 4
  • Weighted_Rating = (2 ⋅ 3 + 1 ⋅ 4 + 3 ⋅ 5) / (3 + 4) = 3.57☆
  • Average = 4.75☆
  1. For 10 ratings of 4
  • Weighted_Rating = (2 ⋅ 3 + 10 ⋅ 4) / (3 + 10) = 3.54☆
  • Average = 4☆
  1. For 1 ratings of 5
  • Weighted_Rating = (2 ⋅ 3 + 5 ⋅ 1) / (3 + 1) = 2.75☆
  • Average = 5☆

About

Bayesian approach to calculating review ratings with Google Maps integration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages