algo-rank-bayesian

Solid

"Apply Bayesian averaging to rank items by combining observed ratings with prior expectations. Use this skill when the user needs to rank items with varying review counts, build a 'top rated' list that handles low-sample items fairly, or implement IMDB-style weighted rating — even if they say 'weighted average rating', 'IMDB formula', or 'ranking with prior'.".

AI & Automation 22 stars 8 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
45
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Bayesian Average Rating ## Overview Bayesian average combines an item's observed average rating with a prior (global average), weighted by review count. Formula: BR = (C × m + Σrᵢ) / (C + n) where m=global mean, C=confidence parameter, n=item reviews, Σrᵢ=sum of item ratings. Items with few reviews are pulled toward the global mean. ## When to Use **Trigger conditions:** - Ranking items by continuous ratings (1-5 stars) with varying review counts - IMDB-style "Top 250" lists that balance quality and popularity - Any rating aggregation where new items shouldn't dominate with few high ratings **When NOT to use:** - For binary (upvote/downvote) data (use Wilson Score instead) - When all items have similar review counts (simple average is sufficient) ## Algorithm ``` IRON LAW: The Prior Protects Against Small-Sample Extremes Without a prior, a single 5-star review makes an item "the best." The Bayesian average adds C "phantom votes" at the global mean m, shrinking small-sample items toward average. C controls shrinkage strength: higher C = more conservative (more phantom votes). Typical C = median review count across all items. ``` ### Phase 1: Input Validation Compute: global mean rating (m) across all items, choose C (phantom vote count). Collect per item: review count (n), average rating, or sum of ratings. **Gate:** m computed, C selected, item data available. ### Phase 2: Core Algorithm 1. Global mean: m = Σ(all ratings) / Σ(all review counts) 2. Bayesian average ...

Details

Author
charlieviettq
Repository
charlieviettq/awesome-agent-skill
Created
2 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

algo-rank-wilson

"Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction. Use this skill when the user needs to rank products by ratings, sort content by approval rate, or build a 'best rated' list that accounts for sample size — even if they say 'rank by star rating', 'best rated with few reviews', or 'confidence-adjusted rating'.".

22 Updated 1 weeks ago
charlieviettq
AI & Automation Solid

algo-rank-elo

"Implement Elo rating system to rank items or players from pairwise comparison outcomes. Use this skill when the user needs to rank items from head-to-head matchups, build a competitive rating system, or evaluate relative quality from comparison data — even if they say 'player rating', 'ranking from comparisons', or 'competitive scoring system'.".

22 Updated 1 weeks ago
charlieviettq
AI & Automation Listed

bayesian-reasoning

Activate when: user says 'Bayesian', 'prior', 'posterior', 'base rate', 'likelihood ratio', or 'update my belief'; someone treats 'the evidence is consistent with X' as proof of X; a high-stakes decision rests on interpreting a test result, security alert, fraud flag, A/B result, or hiring signal; base rates are being ignored in favor of a vivid story. Do NOT activate when: the decision is genuinely deterministic and probabilities do not apply; there is no data or domain knowledge to anchor a prior (Bayes amplifies information, it does not create it from nothing). More: deciqai.com/s/bayesian-reasoning

3 Updated 2 days ago
deciqAI