squared_distance_profile¶
- squared_distance_profile(X: ndarray | List, q: ndarray, mask: ndarray) ndarray[source]¶
Compute a distance profile using the squared Euclidean distance.
It computes the distance profiles between the input time series and the query using the squared Euclidean distance. The distance between the query and a candidate is comptued using a dot product and a rolling sum to avoid recomputing parts of the operation.
- Parameters:
- Xnp.ndarray, 3D array of shape (n_cases, n_channels, n_timepoints)
The input samples. If X is an unquel length collection, expect a numba TypedList 2D array of shape (n_channels, n_timepoints)
- qnp.ndarray, 2D array of shape (n_channels, query_length)
The query used for similarity search.
- masknp.ndarray, 3D array of shape (n_cases, n_timepoints - query_length + 1)
Boolean mask of the shape of the distance profile indicating for which part of it the distance should be computed.
- Returns:
- distance_profilenp.ndarray
3D array of shape (n_cases, n_timepoints - query_length + 1) The distance profile between q and the input time series X.