Skip to main content

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.

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:

  1. define your data, LR system and experiments in a YAML file;
  2. 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.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

  1. Install RedHat's YAML extension.
  2. Point the extension to the validation schema. This can be done in two ways:
    1. Add

        "yaml.schemas": {
            "lir.schema.json": "*.yaml"
        }
      

      to settings.json.

    2. Open settings (ctrl + ,), find the Yaml: Schemas settings and create an entry with lir.schema.json as item and *.yaml as 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.

Release files for lir 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lir 1.8.0
File Interpreter ABI Platform
lir-1.8.0-py3-none-any.whl Python 3 none any Details

Release files / lir-1.8.0-py3-none-any.whl

Download URL lir-1.8.0-py3-none-any.whl
Size 190.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4ec012d0f0bd18548daed138f00ac4dc4a109a247d18f7327c97b52e1fb730d
BLAKE2b-256 checksum
How to use checksums
8e938848fc6e818594eac525426def1121d09759de2545fa8b9f2d96aa7fe22f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.0 This release

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.1.29

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page