Download the PHP package ilicmiljan/weighted-ratings without Composer
On this page you can find all versions of the php package ilicmiljan/weighted-ratings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ilicmiljan/weighted-ratings
More information about ilicmiljan/weighted-ratings
Files in ilicmiljan/weighted-ratings
Package weighted-ratings
Short Description A lightweight PHP library for calculating the Wilson Lower Bound Score and Bayesian Approximation weights for sorting algorithms based on user feedback.
License MIT
Informations about the package weighted-ratings
Weighted Ratings
A lightweight PHP library for calculating the Wilson Lower Bound Score and Bayesian Approximation weights for sorting algorithms based on user feedback.
Installation
Weighted Ratings Library is available via Composer. Just add this line to
your composer.json
file:
or you can run:
Note that the vendor
folder and the vendor/autoload.php
script are generated
by Composer and they are not part of Weighted Ratings Library.
Configuration
Available Formulas
Optional Configuration Parameters
ausmeNegativeRatingisLessThan
- Number of stars in the rating that are assumed as negative (Default: 3)confidence
- Statistical Confidence used in Formulas (Default: 0.95)
Without RatingWeightConfig
You can use default optional config parameters to calculate weights without instantiating RateLimiterConfig
.
This can be achieved by setting the formula
in the instance of RatingWeightCalculator
.
Using RatingWeightConfig
You can create a new instance of RatingWeightConfig
with all the parameters and pass it to the RatingWeightCalculator
.
Changing Formula
The formula for one instance of RatingWeightCalculator
can be set only once. Changing formula in the runtime will throw an exception.
Usage
With Default Config Parameters
With Custom Parameters
Testing
To run Unit Tests inside this library you can use this command:
Infection PHP Metrics:
- Mutation Score Indicator (MSI): 98%
- Mutation Code Coverage: 100%
- Covered Code MSI: 98%