LIR Python Likelihood Ratio Toolkit
Toolkit for developing, optimising and evaluating Likelihood Ratio (LR) systems. This allows benchmarking of LR systems on different datasets, investigating impact of different sampling schemes or techniques, and doing case-based validation and computation of case LRs.
LIR was first released in 2020 and redesigned from scratch in 2025, replacing the previous repository.
References
- LiR documentation: comprehensive overview, terminology and more on developing LR systems
- Practitioner Guide (branch | paper | notebook): case study using LiR to develop an LR system using LiR
- Quick Start: selecting / designing the proper LR system based on your data
Installation
LIR is compatible with Python 3.12 / 3.13/ 3.14. The easiest way to install LIR is to use pip:
pip install lir
Usage
This repository offers both a Python API and a command-line interface.
Lir uses matplotlib for plotting, with the Agg backend as default. If you want to use a different backend, you can set the MPLBACKEND environment variable to your preferred backend. For example, to use the TkAgg backend, you can run:
export MPLBACKEND=TkAgg
Command-line interface
LiR can be launched from the command line as follows:
lir --help
Or, alternatively:
python -m lir
Evaluate an LR system using the command-line interface as follows:
- define your data, LR system and experiments in a YAML file;
- run
lir <yaml file>.
The examples folder may be a good starting point for setting up an experiment.
The elements of the experiment configuration YAML are looked up in the registry. The following lists all available elements in the registry.
lir --list-registry
Setting up the validation schema
A schema that validates lir configuration yaml files is available, namely lir/resources/config-schema.json. This schema can be used to validate a specific yaml file by using
lir --validate your_experiment.yaml
Next to this, most modern IDEs support JSON/YAML schema validation.
PyCharm
To specify the schema in PyCharm, see this official documentation entry.
Visual Studio Code
- Install RedHat's YAML extension.
- Point the extension to the validation schema. This can be done in two ways:
-
Add
"yaml.schemas": { "lir/resources/config-schema.json": "*.yaml" }
to
settings.json. -
Open settings (
ctrl+,), find theYaml: Schemassettings and create an entry withlir/resources/config-schema.jsonas item and*.yamlas value.
-
Contributing / Development
Contributions are highly welcomed. If you'd like to contribute to the LiR package, please follow the steps as described in the CONTRIBUTING.md file.
Metadata
Release files for lir 1.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lir-1.9.1-py3-none-any.whl | Python 3 | none | any | Details for lir-1.9.1-py3-none-any.whl |
Release files / lir-1.9.1-py3-none-any.whl
| Download URL | lir-1.9.1-py3-none-any.whl |
|---|---|
| Size | 220.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90a9410aac06ee2146d9d878deea2625df7aeceeccb93d19901a09ff47cd7955
|
|
BLAKE2b-256 checksum How to use checksums |
7b80c0ee24d63d2fa4c860d4e59bde17bc9b6695afd3ae2eaf7538e37e1814fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for lir 1.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for lir-1.9.1-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.