normalized_naive_distance_profile¶
- normalized_naive_distance_profile(X: ndarray | List, q: ndarray, mask: ndarray | List, X_means: ndarray | List, X_stds: ndarray | List, q_means: ndarray, q_stds: ndarray, distance_function: ndarray, distance_args: dict | None = None) ndarray | List[source]¶
Compute a distance profile in a brute force way.
It computes the distance profiles between the input time series and the query using the specified distance. The search is made in a brute force way without any optimizations and can thus be slow.
A distance profile between a (univariate) time series \(X_i = {x_1, ..., x_m}\) and a query \(Q = {q_1, ..., q_m}\) is defined as a vector of size \(m-( l-1)\), such as \(P(X_i, Q) = {d(C_1, Q), ..., d(C_m-(l-1), Q)}\) with d the distance function, and \(C_j = {x_j, ..., x_{j+(l-1)}}\) the j-th candidate subsequence of size \(l\) in \(X_i\).
- 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 shape (n_cases, n_channels, 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. Should be a numba TypedList if X is unequal length.
- X_meansnp.ndarray, 3D array of shape (n_cases, n_channels, n_timepoints - query_length + 1) # noqa: E501
Means of each subsequences of X of size query_length. Should be a numba TypedList if X is unequal length.
- X_stdsnp.ndarray, 3D array of shape (n_cases, n_channels, n_timepoints - query_length + 1) # noqa: E501
Stds of each subsequences of X of size query_length. Should be a numba TypedList if X is unequal length.
- q_meansnp.ndarray, 1D array of shape (n_channels)
Means of the query q
- q_stdsnp.ndarray, 1D array of shape (n_channels)
Stds of the query q
- distance_functionfunc
A python function or a numba njit function used to compute the distance between two 1D vectors.
- distance_argsdict, default=None
Dictionary containing keywords arguments to use for the distance_function
- Returns:
- distance_profilesnp.ndarray
3D array of shape (n_cases, n_channels, n_timepoints - query_length + 1) The distance profile between q and the input time series X independently for each channel. Returns a numba TypedList if X is unequal length.