Build arbitrary contrasts for models defined with formulaic.
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!
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:
- Install the latest release of
formulaic-contrasts
from PyPI:
pip install formulaic-contrasts
- 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.
See the changelog.
For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.
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.