From 15ef7f76cd1faa11e376c79fb975d97a27ef845a Mon Sep 17 00:00:00 2001 From: rchan Date: Thu, 2 Nov 2023 12:24:40 +0000 Subject: [PATCH 1/2] fix #12 --- .../sig_mahal_knn.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/signature_mahalanobis_knn/sig_mahal_knn.py b/src/signature_mahalanobis_knn/sig_mahal_knn.py index 38c6dbc..5e4d97c 100644 --- a/src/signature_mahalanobis_knn/sig_mahal_knn.py +++ b/src/signature_mahalanobis_knn/sig_mahal_knn.py @@ -106,17 +106,25 @@ def fit( ) # set default kwargs for signature transformer if not provided - if signature_kwargs is None or signature_kwargs == {}: - signature_kwargs = { - "augmentation_list": ("addtime",), - "window_name": "global", - "window_depth": None, - "window_length": None, - "window_step": None, - "rescaling": None, - "sig_tfm": "signature", - "depth": 2, - } + sig_defaults = { + "augmentation_list": ("addtime",), + "window_name": "global", + "window_depth": None, + "window_length": None, + "window_step": None, + "rescaling": None, + "sig_tfm": "signature", + "depth": 2, + } + + if signature_kwargs is None: + # set all defaults + signature_kwargs = sig_defaults + else: + # set defaults for any missing kwargs + for key, value in sig_defaults.items(): + if key not in signature_kwargs: + signature_kwargs[key] = value self.signature_transform = SignatureTransformer( **signature_kwargs, From 53d66827d14fbef5b6b4c62680432b0025b478a8 Mon Sep 17 00:00:00 2001 From: rchan Date: Wed, 22 Nov 2023 15:28:30 +0000 Subject: [PATCH 2/2] add transform-euclidean --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 767f6cf..55e87cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ ] dynamic = ["version"] dependencies = [ - "sktime", + "sktime >= 0.24.1", "numpy", "scikit-learn", "pynndescent",