• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Updated Sorting By rating weighted value instead of rating average value

Bob

Developer
Staff member
... Suggestion from a Showcase Early Adopter (EA) license holder made at my private development site.

ProWeb said:
Right now the default sort order is by "views". We did this when we converted to the XF because it was the closest proxy we had for the "nicest" coop pages.

Ideally we'd like to move to a sort by "ratings"... In theory this would be BEST... but the problem is that a page with one 5 star review (let's say a friend gave it to someone's crappy page) will rank higher than a page with dozens of 4.9 reviews.

Is there any way to weight "sort by ratings" such that the number of ratings is taken into account?

How does Resource Manager do it? When I sort by "ratings" here, it looks like it's taking into account the number of reviews AND the average review, no?

When I sort by "rating", we get all the 5-star reviews first... even if it's just one review:
Chicken Coops | BackYard Chickens

Thanks!

In a nut shell, I am switching from sorting by the Rating Average to sorting by Rating Weighted.

ProWeb said:
(BTW, the geek in me is curious how weighting is calculated... is it just something simple like "average rating" multiplied=by "# reviews"?)
Its based on this : Bayesian average - Wikipedia
PHP:
    // same as the xf resource manager to maintain a standard.
    public static $voteThreshold = 10;
    public static $averageVote = 3;

    public function getWeightedRating($count, $sum)
    {
        return (self::$voteThreshold * self::$averageVote + $sum) / (self::$voteThreshold + $count);
    }
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
This is a fairly massive change that could result in needing to update several OPTIONS and CATEGORIES (depending on if you are currently using any settings that set the sort order to RATED or REVIEWED.

At a minimum, you are going to need to SAVE OPTIONS after upgrading as several options keys have changed from 'rated' to 'rating_weighted' and 'reviewed' to 'review_count'.

Categories also have several sort order options pertaining to ordering by 'rated' or 'reviewed', so if you have those set, the system will throw errors for Undefined Index until you edit those categories and reset your sort order options.

NOTE: This also effects CTA Featured Thread integration option settings AND [bd] Widget Framework integration (widget settings).
 
Back
Top