formulaic-contrasts#

Tests Documentation codecov.io

Build arbitrary contrasts for models defined with formulaic.

Getting started#

Please refer to the documentation. As a developer seeking to use formulaic-contrasts with your model, you’ll find the API documentation and the tutorial Usage in custom model useful. If you are a user who wants to understand how to build contrasts for a model, the building contrasts tutorial is for you!

Installation#

Typically, you don’t install formulaic-contrasts directly, but obtain it as a dependency of another model. As a developer, you can obtain it from PyPI or GitHub:

There are several alternative options to install formulaic-contrasts:

  1. Install the latest release of formulaic-contrasts from PyPI:

pip install formulaic-contrasts
  1. Install the latest development version:

pip install git+https://github.com/scverse/formulaic-contrasts.git@main

Formulaic-contrasts depends on Python 3.10 or later.

Release notes#

See the changelog.

Contact#

For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.

Credits#

The cond() function for building contrasts has been devised by @const-ae for his R package glmGamPoi. A prototype of the Python implementation has been built at the scverse hackathon in Cambridge, UK in Nov 2023 by @grst, @const-ae and @BorisMuzellec. The production version in this package has been implemented by @grst.

formulaic-contrasts is part of the scverse® project (website, governance) and is fiscally sponsored by NumFOCUS. If you like scverse® and want to support our mission, please consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.