Metadata-Version: 2.4
Name: rmp-ci
Version: 0.2.0
Summary: Bayesian confidence intervals for RateMyProfessors ratings (inspired by 3Blue1Brown)
Project-URL: Homepage, https://github.com/broyojo/rmp-ci
Author-email: David <broyojo@example.com>
License-Expression: MIT
Keywords: 3blue1brown,bayesian,beta-distribution,confidence-interval,ratemyprofessors
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# rmp-ci

Bayesian confidence intervals for [RateMyProfessors](https://www.ratemyprofessors.com/) ratings.

Inspired by [3Blue1Brown's video](https://youtu.be/8idr1WZ1A7Q) 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

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

## Usage

```bash
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