You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function takes a **single input time series**, splits it into **non-overlapping** contiguous subsequences (windows) of fixed length `l`, and clusters those subsequences into `k` groups.
4931
+
4932
+
**Name:** Cluster
4933
+
4934
+
**Input Series:** Only support single input numeric series. The type is INT32 / INT64 / FLOAT / DOUBLE. Points are read in time order; trailing samples that do not fill a full window are dropped (only `⌊n/l⌋` windows are used, where `n` is the number of valid points).
4935
+
4936
+
**Parameters:**
4937
+
4938
+
| Name | Meaning | Default | Notes |
4939
+
|------|---------|---------|--------|
4940
+
|`l`| Subsequence (window) length | (required) | Positive integer; each window has `l` consecutive samples. |
4941
+
|`k`| Number of clusters | (required) | Integer ≥ 2. |
4942
+
|`method`| Clustering algorithm |`kmeans`| Optional: `kmeans`, `kshape`, `medoidshape` (case-insensitive). Defaults to k-means if omitted. |
4943
+
|`norm`| Z-score normalize each subsequence |`true`| Boolean; if `true`, each subsequence is standardized before clustering. |
4944
+
|`maxiter`| Maximum iterations |`200`| Positive integer. |
4945
+
|`output`| Output mode |`label`|`label`: one cluster id per window; `centroid`: concatenate the `k` centroid vectors in cluster order. |
4946
+
|`sample_rate`| Greedy sampling rate |`0.3`| Used only when **`method` = `medoidshape`**; must be in `(0, 1]`. |
4947
+
4948
+
4949
+
**`method` details:**
4950
+
4951
+
-**kmeans**: k-means in Euclidean space (optionally after per-window normalization).
4952
+
-**kshape**: Assign by shape-based distance (SBD from normalized cross-correlation, NCC); centroids updated via SVD on the cluster matrix.
4953
+
-**medoidshape**: Coarsely cluster, then greedy selection of `k` representative subsequences; `sample_rate` controls how many candidates are sampled each round.
4954
+
4955
+
**Output Series:** Controlled by `output`:
4956
+
4957
+
-**`output` = `label` (default):** One output series, type **INT32**. Number of points = number of full windows, `⌊n/l⌋`. Timestamp of each point = **time of the first sample** in that window; value = cluster id **0 … k−1**.
4958
+
-**`output` = `centroid`:** One output series, type **DOUBLE**. Number of points = **`k × l`**: for clusters **0 → k−1**, emit the `l` components of each centroid in order (concatenated). Timestamps are `0, 1, 2, …` (placeholders only, no physical time meaning).
4959
+
4960
+
**Note:**
4961
+
4962
+
- Require valid point count `n ≥ l` and window count `⌊n/l⌋ ≥ k`.
4963
+
4964
+
#### Examples
4965
+
4966
+
##### KShape: window length 3, k = 2
4967
+
4968
+
Nine samples `{1,2,3,10,20,30,1,5,1}` form three non-overlapping windows `{1,2,3}`, `{10,20,30}`, `{1,5,1}`. With **`method` = `kshape`** (default `norm` = `true`), each output row is the cluster id for one window; timestamps are the window start times. Resulting labels: **0, 0, 1**.
This function takes a **single input time series**, splits it into **non-overlapping** contiguous subsequences (windows) of fixed length `l`, and clusters those subsequences into `k` groups.
4990
+
4991
+
**Name:** Cluster
4992
+
4993
+
**Input Series:** Only support single input numeric series. The type is INT32 / INT64 / FLOAT / DOUBLE. Points are read in time order; trailing samples that do not fill a full window are dropped (only `⌊n/l⌋` windows are used, where `n` is the number of valid points).
4994
+
4995
+
**Parameters:**
4996
+
4997
+
| Name | Meaning | Default | Notes |
4998
+
|------|---------|---------|--------|
4999
+
|`l`| Subsequence (window) length | (required) | Positive integer; each window has `l` consecutive samples. |
5000
+
|`k`| Number of clusters | (required) | Integer ≥ 2. |
5001
+
|`method`| Clustering algorithm |`kmeans`| Optional: `kmeans`, `kshape`, `medoidshape` (case-insensitive). Defaults to k-means if omitted. |
5002
+
|`norm`| Z-score normalize each subsequence |`true`| Boolean; if `true`, each subsequence is standardized before clustering. |
5003
+
|`maxiter`| Maximum iterations |`200`| Positive integer. |
5004
+
|`output`| Output mode |`label`|`label`: one cluster id per window; `centroid`: concatenate the `k` centroid vectors in cluster order. |
5005
+
|`sample_rate`| Greedy sampling rate |`0.3`| Used only when **`method` = `medoidshape`**; must be in `(0, 1]`. |
5006
+
5007
+
5008
+
**`method` details:**
5009
+
5010
+
-**kmeans**: k-means in Euclidean space (optionally after per-window normalization).
5011
+
-**kshape**: Assign by shape-based distance (SBD from normalized cross-correlation, NCC); centroids updated via SVD on the cluster matrix.
5012
+
-**medoidshape**: Coarsely cluster, then greedy selection of `k` representative subsequences; `sample_rate` controls how many candidates are sampled each round.
5013
+
5014
+
**Output Series:** Controlled by `output`:
5015
+
5016
+
-**`output` = `label` (default):** One output series, type **INT32**. Number of points = number of full windows, `⌊n/l⌋`. Timestamp of each point = **time of the first sample** in that window; value = cluster id **0 … k−1**.
5017
+
-**`output` = `centroid`:** One output series, type **DOUBLE**. Number of points = **`k × l`**: for clusters **0 → k−1**, emit the `l` components of each centroid in order (concatenated). Timestamps are `0, 1, 2, …` (placeholders only, no physical time meaning).
5018
+
5019
+
**Note:**
5020
+
5021
+
- Require valid point count `n ≥ l` and window count `⌊n/l⌋ ≥ k`.
5022
+
5023
+
#### Examples
5024
+
5025
+
##### KShape: window length 3, k = 2
5026
+
5027
+
Nine samples `{1,2,3,10,20,30,1,5,1}` form three non-overlapping windows `{1,2,3}`, `{10,20,30}`, `{1,5,1}`. With **`method` = `kshape`** (default `norm` = `true`), each output row is the cluster id for one window; timestamps are the window start times. Resulting labels: **0, 0, 1**.
This function takes a **single input time series**, splits it into **non-overlapping** contiguous subsequences (windows) of fixed length `l`, and clusters those subsequences into `k` groups.
4909
+
4910
+
**Name:** Cluster
4911
+
4912
+
**Input Series:** Only support single input numeric series. The type is INT32 / INT64 / FLOAT / DOUBLE. Points are read in time order; trailing samples that do not fill a full window are dropped (only `⌊n/l⌋` windows are used, where `n` is the number of valid points).
4913
+
4914
+
**Parameters:**
4915
+
4916
+
| Name | Meaning | Default | Notes |
4917
+
|------|---------|---------|--------|
4918
+
|`l`| Subsequence (window) length | (required) | Positive integer; each window has `l` consecutive samples. |
4919
+
|`k`| Number of clusters | (required) | Integer ≥ 2. |
4920
+
|`method`| Clustering algorithm |`kmeans`| Optional: `kmeans`, `kshape`, `medoidshape` (case-insensitive). Defaults to k-means if omitted. |
4921
+
|`norm`| Z-score normalize each subsequence |`true`| Boolean; if `true`, each subsequence is standardized before clustering. |
4922
+
|`maxiter`| Maximum iterations |`200`| Positive integer. |
4923
+
|`output`| Output mode |`label`|`label`: one cluster id per window; `centroid`: concatenate the `k` centroid vectors in cluster order. |
4924
+
|`sample_rate`| Greedy sampling rate |`0.3`| Used only when **`method` = `medoidshape`**; must be in `(0, 1]`. |
4925
+
4926
+
4927
+
**`method` details:**
4928
+
4929
+
-**kmeans**: k-means in Euclidean space (optionally after per-window normalization).
4930
+
-**kshape**: Assign by shape-based distance (SBD from normalized cross-correlation, NCC); centroids updated via SVD on the cluster matrix.
4931
+
-**medoidshape**: Coarsely cluster, then greedy selection of `k` representative subsequences; `sample_rate` controls how many candidates are sampled each round.
4932
+
4933
+
**Output Series:** Controlled by `output`:
4934
+
4935
+
-**`output` = `label` (default):** One output series, type **INT32**. Number of points = number of full windows, `⌊n/l⌋`. Timestamp of each point = **time of the first sample** in that window; value = cluster id **0 … k−1**.
4936
+
-**`output` = `centroid`:** One output series, type **DOUBLE**. Number of points = **`k × l`**: for clusters **0 → k−1**, emit the `l` components of each centroid in order (concatenated). Timestamps are `0, 1, 2, …` (placeholders only, no physical time meaning).
4937
+
4938
+
**Note:**
4939
+
4940
+
- Require valid point count `n ≥ l` and window count `⌊n/l⌋ ≥ k`.
4941
+
4942
+
#### Examples
4943
+
4944
+
##### KShape: window length 3, k = 2
4945
+
4946
+
Nine samples `{1,2,3,10,20,30,1,5,1}` form three non-overlapping windows `{1,2,3}`, `{10,20,30}`, `{1,5,1}`. With **`method` = `kshape`** (default `norm` = `true`), each output row is the cluster id for one window; timestamps are the window start times. Resulting labels: **0, 0, 1**.
This function takes a **single input time series**, splits it into **non-overlapping** contiguous subsequences (windows) of fixed length `l`, and clusters those subsequences into `k` groups.
4989
+
4990
+
**Name:** Cluster
4991
+
4992
+
**Input Series:** Only support single input numeric series. The type is INT32 / INT64 / FLOAT / DOUBLE. Points are read in time order; trailing samples that do not fill a full window are dropped (only `⌊n/l⌋` windows are used, where `n` is the number of valid points).
4993
+
4994
+
**Parameters:**
4995
+
4996
+
| Name | Meaning | Default | Notes |
4997
+
|------|---------|---------|--------|
4998
+
|`l`| Subsequence (window) length | (required) | Positive integer; each window has `l` consecutive samples. |
4999
+
|`k`| Number of clusters | (required) | Integer ≥ 2. |
5000
+
|`method`| Clustering algorithm |`kmeans`| Optional: `kmeans`, `kshape`, `medoidshape` (case-insensitive). Defaults to k-means if omitted. |
5001
+
|`norm`| Z-score normalize each subsequence |`true`| Boolean; if `true`, each subsequence is standardized before clustering. |
5002
+
|`maxiter`| Maximum iterations |`200`| Positive integer. |
5003
+
|`output`| Output mode |`label`|`label`: one cluster id per window; `centroid`: concatenate the `k` centroid vectors in cluster order. |
5004
+
|`sample_rate`| Greedy sampling rate |`0.3`| Used only when **`method` = `medoidshape`**; must be in `(0, 1]`. |
5005
+
5006
+
5007
+
**`method` details:**
5008
+
5009
+
-**kmeans**: k-means in Euclidean space (optionally after per-window normalization).
5010
+
-**kshape**: Assign by shape-based distance (SBD from normalized cross-correlation, NCC); centroids updated via SVD on the cluster matrix.
5011
+
-**medoidshape**: Coarsely cluster, then greedy selection of `k` representative subsequences; `sample_rate` controls how many candidates are sampled each round.
5012
+
5013
+
**Output Series:** Controlled by `output`:
5014
+
5015
+
-**`output` = `label` (default):** One output series, type **INT32**. Number of points = number of full windows, `⌊n/l⌋`. Timestamp of each point = **time of the first sample** in that window; value = cluster id **0 … k−1**.
5016
+
-**`output` = `centroid`:** One output series, type **DOUBLE**. Number of points = **`k × l`**: for clusters **0 → k−1**, emit the `l` components of each centroid in order (concatenated). Timestamps are `0, 1, 2, …` (placeholders only, no physical time meaning).
5017
+
5018
+
**Note:**
5019
+
5020
+
- Require valid point count `n ≥ l` and window count `⌊n/l⌋ ≥ k`.
5021
+
5022
+
#### Examples
5023
+
5024
+
##### KShape: window length 3, k = 2
5025
+
5026
+
Nine samples `{1,2,3,10,20,30,1,5,1}` form three non-overlapping windows `{1,2,3}`, `{10,20,30}`, `{1,5,1}`. With **`method` = `kshape`** (default `norm` = `true`), each output row is the cluster id for one window; timestamps are the window start times. Resulting labels: **0, 0, 1**.
0 commit comments