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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lir-1.7.1-py3-none-any.whl (154.3 kB view details)

Uploaded Python 3

File details

Details for the file lir-1.7.1-py3-none-any.whl.

File metadata

  • Download URL: lir-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 154.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lir-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2463acae10bddec57f6eee66c3b41c42d3fa08bc2cff1f8660b0c1283d9a96
MD5 1d481c422c82b76ee892106ae49a80ff
BLAKE2b-256 78f018a09ab0a54e31c58d00868dbb751e0d71aa19d635fc539700f398283dcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lir-1.7.1-py3-none-any.whl:

Publisher: release.yaml on NetherlandsForensicInstitute/lir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page