account-research
Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect…
\"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 —
Claude Code
$ npx -y skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian --agent claude-code
Codex
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a codex -y
Cursor
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a cursor -y
Gemini CLI
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a gemini-cli -y
GitHub Copilot
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a github-copilot -y
OpenCode
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a opencode -y
Windsurf
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-rank-bayesian -a windsurf -y
name: "\"algo-rank-bayesian\"" description: "\"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'.\"." allowed-tools: Bash, Read, Write, Edit, Glob, Grep
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.
**Trigger conditions:**
**When NOT to use:**
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.
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.
1. Global mean: m = Σ(all ratings) / Σ(all review counts) 2. Bayesian average per item: BR = (C × m + n × avg_rating) / (C + n) 3. Rank items by BR descending 4. For items with n >> C, BR ≈ avg_rating (data dominates). For n << C, BR ≈ m (prior dominates).
Check: items with very few reviews should be near global mean. Items with many reviews should be near their actual average. Ranking is intuitive. **Gate:** Shrinkage behavior confirmed, top items have both high ratings AND sufficient reviews.
Return ranked items with Bayesian scores.
{
"rankings": [{"item": "Movie_A", "bayesian_avg": 8.7, "raw_avg": 9.1, "reviews": 5000, "shrinkage": 0.04}],
"metadata": {"global_mean": 6.8, "confidence_C": 500, "items_ranked": 10000}
}**Input:** m=7.0, C=100. Item A: avg=9.5, n=5. Item B: avg=8.5, n=500. **Expected:** BR_A = (100×7 + 5×9.5)/(105) = 7.12. BR_B = (100×7 + 500×8.5)/(600) = 8.25. B ranks higher.
| Input | Expected | Why | |-------|----------|-----| | n=0 | BR = m (global mean) | No data, fully prior-driven | | n=100000 | BR ≈ raw average | Massive sample overwhelms prior | | All items same n | Equivalent to simple average ranking | Uniform shrinkage, ordering preserved |
| Script | Description | Usage | |--------|-------------|-------| | `scripts/bayesian_avg.py` | Rank items using Bayesian average to handle small-sample extremes | `python scripts/bayesian_avg.py --help` |
Run `python scripts/bayesian_avg.py --verify` to execute built-in sanity tests.
Curated skill pack for LLM agents in engineer and science workflow (Cursor & Claude ready).
Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect…
Evaluate LLM agents and tool-using workflows—task success, tool accuracy, latency/cost, safety, and regression suites. Use when…
Design agent tools and CLI surfaces—schemas, naming, errors, idempotency, and discoverability for LLM callers. Use when defining…
\"Implement and select ad bidding strategies from manual CPC to automated target-CPA and target-ROAS. Use this skill when the…
\"Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to…
\"Build CTR prediction models for estimating ad click-through rates from features. Use this skill when the user needs to predict…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.