Skip to content

Commit 75b788f

Browse files
PimMeulensteenPim Meulensteen (DBS)
andauthored
Remove unused code (#26)
Co-authored-by: Pim Meulensteen (DBS) <pim.meulensteen@nfi.nl>
1 parent ef85e01 commit 75b788f

11 files changed

Lines changed: 1 addition & 1532 deletions

File tree

lrmodule/__init__.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import pickle
22
from pathlib import Path
33

4-
import numpy as np
54
from lir.config.lrsystem_architectures import specific_source
6-
from lir.data.models import FeatureData, LLRData
5+
from lir.data.models import FeatureData
76
from lir.datasets.feature_data_csv import FeatureDataCsvFileParser
87
from lir.lrsystems.lrsystems import LRSystem
98

10-
from lrmodule import persistence
11-
from lrmodule.data_types import ModelSettings
12-
from lrmodule.lrsystem import get_trained_model
13-
149

1510
def get_lr_system(lr_system_folder: Path, file_name: str = "model.pkl") -> LRSystem:
1611
"""
@@ -55,31 +50,6 @@ def get_reference_data(lr_system_folder: Path, file_name: str = "reference_data.
5550
return FeatureDataCsvFileParser(file=reference_data_file, label_column="hypothesis").get_instances()
5651

5752

58-
def get_model(settings: ModelSettings, training_data: FeatureData, model_storage_path: Path | None) -> LRSystem:
59-
"""
60-
Obtain a model by loading it from disk, or by fitting it from training data.
61-
62-
:param settings: model settings
63-
:param training_data: training data
64-
:param model_storage_path: path where trained LR models are stored
65-
:return: a fitted LR system
66-
"""
67-
model = None if not model_storage_path else persistence.load_model(settings, model_storage_path)
68-
if not model:
69-
model = get_trained_model(settings, training_data)
70-
if model_storage_path:
71-
persistence.save_model(model, settings, model_storage_path)
72-
return model
73-
74-
75-
def calculate_llrs(
76-
features: np.ndarray, settings: ModelSettings, training_data: FeatureData, model_storage_path: Path | None
77-
) -> LLRData:
78-
"""Calculate LLRs after fitting a model with a training set."""
79-
model = get_model(settings, training_data, model_storage_path)
80-
return model.apply(FeatureData(features=features))
81-
82-
8353
# create an alias for the specific source system, since the architecture is identical but the name is misleading
8454
# in the current application
8555
binary_lrsystem = specific_source

lrmodule/lrsystem.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

lrmodule/persistence.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

lrmodule/resources/__init__.py

Whitespace-only changes.

lrmodule/resources/lrsystem_firing_pin_impression_accf.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/characterization_test/characterization_test.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)