Closed higurbuzz closed 9 months ago
See #894.
This PR adds a reliability
field to the get all method responses of resources
, needs
, and events
. The reliability score is calculated based on the upvotes and downvotes for each item. It is used to assess the credibility and trustworthiness of the information provided by users.
The reliability score is calculated using the Wilson Score Interval, a statistical method that takes into account the proportion of upvotes to total votes while considering the %95 confidence interval. The formula is:
z = 1.96 # 95% confidence interval
phat = upvotes / total_votes
reliability = (phat + z^2 / (2 * total_votes) - z * sqrt((phat * (1 - phat) + z^2 / (4 * total_votes)) / total_votes)) / (1 + z^2 / total_votes)
upvotes
: The number of upvotes for the item.downvotes
: The number of downvotes for the item.total_votes
: The total number of votes (upvotes + downvotes).The reliability score ranges from 0 to 1, with higher values indicating higher reliability. Items with more upvotes and a higher proportion of upvotes to total votes will have a higher reliability score, reflecting greater trustworthiness.
To sort by reliability, simply add sort_by=reliability&order=desc
or sort_by=reliability&order=asc
to the query.
Issue Description
Sort by reliability should be provided instead upvote/downvote count.
Deadline of the Issue
24.12.2023
Reviewer
None