We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 816577a commit 046ddb3Copy full SHA for 046ddb3
aeon/segmentation/tests/test_hidalgo.py
@@ -9,3 +9,33 @@ def test_partition_function():
9
assert p == 8.0
10
b = _binom(10, 2)
11
assert b == 45.0
12
+
13
14
+def test_hidalgo_zero_distance_duplicate_rows():
15
+ """Test that Hidalgo handles duplicate rows without numerical errors."""
16
+ import numpy as np
17
18
+ from aeon.segmentation._hidalgo import HidalgoSegmenter
19
20
+ X = np.array(
21
+ [
22
+ [1.0, 2.0, 3.0],
23
24
+ [4.0, 5.0, 6.0],
25
+ [7.0, 8.0, 9.0],
26
+ ]
27
+ )
28
29
+ seg = HidalgoSegmenter(
30
+ K=2,
31
+ q=2,
32
+ n_iter=50,
33
+ burn_in=0.2,
34
+ sampling_rate=5,
35
+ seed=1,
36
37
38
+ out = seg.fit_predict(X, axis=0)
39
+ assert out is not None
40
+ assert isinstance(out, np.ndarray)
41
+ assert len(out) == len(X)
0 commit comments