Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion aeon/classification/distance_based/_elastic_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ def get_inclusive(min_val: float, max_val: float, num_vals: float):
return np.arange(min_val, max_val + inc / 2, inc)

if distance_measure == "dtw" or distance_measure == "ddtw":
return {"distance_params": [{"window": x / 100} for x in range(0, 100)]}
constrained_params = [{"window": x / 100} for x in range(1, 100)]
unconstrained_param = {"window": 1.0}
return {"distance_params": [unconstrained_param] + constrained_params}
elif distance_measure == "wdtw" or distance_measure == "wddtw":
return {"distance_params": [{"g": x / 100} for x in range(0, 100)]}
elif distance_measure == "lcss":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,18 @@ def test_all_distance_measures():
ee.fit(X, y)
distances = list(ee.get_metric_params())
assert len(distances) == 9


@pytest.mark.parametrize("data", [DATA])
def test_dtw_ddtw_full_window_inclusion(data):
"""Test that window=1.0 (full window) is included in DTW/DDTW parameters."""
dtw_paras = ElasticEnsemble._get_100_param_options("dtw", data)
dtw_param_values = dtw_paras["distance_params"]
dtw_windows = {p.get("window") for p in dtw_param_values}
assert 1.0 in dtw_windows
assert len(dtw_param_values) == 100
ddtw_paras = ElasticEnsemble._get_100_param_options("ddtw", data)
ddtw_param_values = ddtw_paras["distance_params"]
ddtw_windows = {p.get("window") for p in ddtw_param_values}
assert 1.0 in ddtw_windows
assert len(ddtw_param_values) == 100
1 change: 1 addition & 0 deletions docs/changelogs/v1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ September 2025
- [ENH] KNN n_jobs and updated kneighbours method ({pr}`2578`) {user}`chrisholder`
- [ENH] Refactor signature code ({pr}`2943`) {user}`TonyBagnall`
- [ENH] Change seed to random_state ({pr}`3031`) {user}`TonyBagnall`
- [ENH] Include unconstrained DTW and DDTW in Elastic Ensemble ({pr}`3112`) {user}`Nithurshen`

## Clustering

Expand Down