[gnome-software] trivial: Fix wilson score calulation for Ubuntu reviews



commit b79f2ba23d282f26a648b8827fa2301cd984a9c8
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Jun 8 12:01:18 2016 +1200

    trivial: Fix wilson score calulation for Ubuntu reviews

 src/plugins/gs-plugin-ubuntu-reviews.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/gs-plugin-ubuntu-reviews.c b/src/plugins/gs-plugin-ubuntu-reviews.c
index 6ad884a..b60b994 100644
--- a/src/plugins/gs-plugin-ubuntu-reviews.c
+++ b/src/plugins/gs-plugin-ubuntu-reviews.c
@@ -212,11 +212,10 @@ get_rating (gint64 one_star_count, gint64 two_star_count, gint64 three_star_coun
 
        // Use a Wilson score which is a method of ensuring small numbers of ratings don't give high scores
        // https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
-       return ((wilson_score (one_star_count, n_ratings, 0.1) * 20) +
-               (wilson_score (two_star_count, n_ratings, 0.1) * 40) +
-               (wilson_score (three_star_count, n_ratings, 0.1) * 60) +
-               (wilson_score (four_star_count, n_ratings, 0.1) * 80) +
-               (wilson_score (five_star_count, n_ratings, 0.1) * 100));
+       return (((wilson_score (one_star_count, n_ratings, 0.1) * -2) +
+                (wilson_score (two_star_count, n_ratings, 0.1) * -1) +
+                (wilson_score (four_star_count, n_ratings, 0.1) * 1) +
+                (wilson_score (five_star_count, n_ratings, 0.1) * 2)) + 3) * 20;
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]