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.
- 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
LIR is compatible with Python 3.12 / 3.13/ 3.14. The easiest way to install LIR is to use pip:
pip install lirThis repository offers both a Python API and a command-line interface.
LiR can be launched from the command line as follows:
lir --helpOr, alternatively:
python -m lirEvaluate 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
A schema that validates lir configuration yaml files is availible, namely lir.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.
To specify the schema in PyCharm, see this official documentation entry.
- Install RedHat's YAML extesion.
- Point the extension to the validation schema. This can be done in two ways:
-
Add
"yaml.schemas": { "lir.schema.json": "*.yaml" }
to
settings.json. -
Open settings (
ctrl+,), find theYaml: Schemassettings and create an entry withlir.schema.jsonas item and*.yamlas value.
-
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.