Skip to main content

Bayesian confidence intervals for RateMyProfessors ratings (inspired by 3Blue1Brown)

Project description

rmp-ci

Bayesian confidence intervals for RateMyProfessors ratings.

Inspired by 3Blue1Brown's video on binomial distributions and the beta distribution — why you shouldn't trust online ratings at face value.

The Problem

A professor with 2 ratings averaging 5.0/5 looks better than one with 200 ratings averaging 4.5/5. But the first professor's true quality is far more uncertain. This tool computes a Bayesian credible interval using the Dirichlet-Multinomial model to quantify that uncertainty.

Why Dirichlet?

The 3b1b video uses the Beta distribution, which requires collapsing star ratings into binary (positive/negative). This tool uses the Dirichlet distribution — the multivariate generalization of Beta — which models all 5 star categories simultaneously. This gives you a credible interval directly on the expected star rating (1–5) without any arbitrary cutoff.

  • Prior: Dir(1,1,1,1,1) — uniform over all 5 categories
  • Posterior: Dir(n₁+1, n₂+1, n₃+1, n₄+1, n₅+1)
  • CI computed via Monte Carlo sampling from the posterior

Install

pip install rmp-ci
# or
uv tool install rmp-ci
# or
pipx install rmp-ci

Usage

rmp-ci "Chao Zhang" -s "Georgia Tech"
rmp-ci "Mark Riedl" -s "Georgia Tech"
rmp-ci "Lingming Zhang" -s "UIUC"

# JSON output for piping
rmp-ci "Chao Zhang" -s "Georgia Tech" --json | jq .bayesian

# Custom confidence level
rmp-ci "Chao Zhang" -s "Georgia Tech" -c 0.90

# More Monte Carlo samples for tighter estimate
rmp-ci "Chao Zhang" -s "Georgia Tech" -n 200000

Zero dependencies — pure Python stdlib.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rmp_ci-0.3.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rmp_ci-0.3.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file rmp_ci-0.3.0.tar.gz.

File metadata

  • Download URL: rmp_ci-0.3.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rmp_ci-0.3.0.tar.gz
Algorithm Hash digest
SHA256 85a0981d70a44e4b31542b49c662bf2a23736f0a32d320d570d4d78c9b0baf7a
MD5 95d89985ed750ef65d21077a4f1a1970
BLAKE2b-256 216a9f020c21e6a561a4259dec0a64e036a80bdd553d5c34aa52326d6adcc476

See more details on using hashes here.

File details

Details for the file rmp_ci-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: rmp_ci-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rmp_ci-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3395ba349dd80c8737a85620f78b813912fb07c6951d9eb85120fc624fdfcad5
MD5 05e9705dfbc0b34460217f943445aca8
BLAKE2b-256 9f8b7b6d3c0904f6e95ba648ef033a86a83d0c61277140b087928b5271dcc0ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page