Package for optimising and evaluating Likelihood Ratio (LR) systems.
Project description
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:
- 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 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.
PyCharm
To specify the schema in PyCharm, see this official documentation entry.
Visual Studio Code
- 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.
-
Datasets
There are currently a number of datasets implemented for this project:
- glass: LA-ICP-MS measurements of elemental concentration from floatglass. The data will be downloaded automatically from https://github.com/NetherlandsForensicInstitute/elemental_composition_glass when used in the pipeline for the first time.
Simulations
It is straightforward to simulate data for experimentation. Currently two very simple simulations
synthesized_normal_binary and synthesized_normal_multiclass are available, with sources and measurements drawn from
normal distributions.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lir-1.4.0-py3-none-any.whl.
File metadata
- Download URL: lir-1.4.0-py3-none-any.whl
- Upload date:
- Size: 123.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7219a9c43a14b7760add4ecb8cba840953f59c72e7a0557de2435e54e9e0b89
|
|
| MD5 |
f167e381b52101e42fc41c73e6a2b754
|
|
| BLAKE2b-256 |
f5a77f866d926c11b1d35bfa09a2ec6c1bbf73fab5454ebb510776a4376b9d3c
|
Provenance
The following attestation bundles were made for lir-1.4.0-py3-none-any.whl:
Publisher:
release.yaml on NetherlandsForensicInstitute/lir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lir-1.4.0-py3-none-any.whl -
Subject digest:
d7219a9c43a14b7760add4ecb8cba840953f59c72e7a0557de2435e54e9e0b89 - Sigstore transparency entry: 1074909070
- Sigstore integration time:
-
Permalink:
NetherlandsForensicInstitute/lir@abeca6b547b3505e2de68158e49bb1b58491555f -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/NetherlandsForensicInstitute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@abeca6b547b3505e2de68158e49bb1b58491555f -
Trigger Event:
push
-
Statement type: