Statistical ranking models with uncertainty quantification.
To analyze data from Thanksgiving 2025, run
poetry run python src/pears.py
For development (installs package + all dependencies in editable mode):
git clone https://github.com/clarafy/pears.git
cd pears
poetry installFor users installing from GitHub:
pip install git+https://github.com/clarafy/pears.gitTo install a specific tagged version:
pip install git+https://github.com/clarafy/pears.git@v1.0.0Replace v1.0.0 with the desired version tag.
# Run tests
poetry run pytest
# Activate virtual environment
poetry shell
# Add a new dependency
poetry add package-name
# Add a dev dependency
poetry add --group dev package-name
# Run pre-commit hooks manually
poetry run pre-commit run --all-files
# Update pre-commit hook versions
poetry run pre-commit autoupdateThis project uses bump-my-version for semantic versioning.
# Bump patch version (0.1.0 → 0.1.1) - bug fixes
poetry run bump-my-version bump patch
# Bump minor version (0.1.0 → 0.2.0) - new features
poetry run bump-my-version bump minor
# Bump major version (0.1.0 → 1.0.0) - breaking changes
poetry run bump-my-version bump major
# Preview changes without committing (dry-run)
poetry run bump-my-version bump --dry-run --verbose patchEach bump command will:
- Update version in
pyproject.tomlandsrc/pears/__init__.py - Create a git commit with message "Bump version: X → Y"
- Create a git tag
vX.Y.Z - Leave you ready to push:
git push && git push --tags
from pears import BradleyTerryModel, ConfidenceIntervalRankingStrategy
model = BradleyTerryModel()
model.fit(comparisons)
strategy = ConfidenceIntervalRankingStrategy(alpha=0.05)
ranking = strategy.rank(model)