lir.lrsystems.score_based module
- class lir.lrsystems.score_based.ScoreBasedSystem(preprocessing_pipeline: Transformer | None, pairing_function: PairingMethod, evaluation_pipeline: Transformer | None)[source]
Bases:
LRSystemProvide a representation of a common source, score-based LR system.
In this strategy, it is possible to prepare the data within a preprocessing_pipeline, create corresponding pairs of instances using the pairing_function and subsequently calculate scores as well as transform these scores to LLR’s in the final evaluation_pipeline.
- Parameters:
preprocessing_pipeline (Transformer | None) – Pipeline that preprocesses instances before pairing and evaluation.
pairing_function (PairingMethod) – Pairing method used to construct trace/reference comparisons.
evaluation_pipeline (Transformer | None) – Pipeline that converts scores to likelihood-ratio outputs.
- apply(instances: InstanceData) LLRData[source]
Use LR system to calculate LLR data from the instances.
Applies the score-based LR system on a set of instances, optionally with corresponding labels, and returns a representation of the calculated LLR data through the LLRData tuple.
The system takes instances as input, and calculates LLRs for pairs of instances. That means that there is a 2-1 relation between input and output data.
- Parameters:
instances (InstanceData) – Input instances to be processed by this method.
- Returns:
Likelihood-ratio data produced by applying the LR system.
- Return type:
- fit(instances: InstanceData) Self[source]
Fit the model on the instance data.
- Parameters:
instances (InstanceData) – Input instances to be processed by this method.
- Returns:
This LR system instance after fitting the evaluation pipeline.
- Return type:
Self