pyscamp.abjoin_knn

pyscamp.abjoin_knn(a, b, m, k, **kwargs)

[GPU ONLY, EXPERIMENTAL] For each subsequence in time series A, returns its approximate K nearest neighbors in time series B.

Parameters:
  • a (1D array) – Time series to compute the KNN matrix profile for.

  • b (1D array) – Time series in which to search for matches.

  • m (int) – Subsequence length to use for computing the matrix profile.

  • k (int) – Number of neighbors to return for each subsequence.

  • threshold (float, optional) – Correlation threshold [0,1] (Default 0), matches which have a correlation less than the threshold will be ignored

Returns:

List of tuples (col, row, distance) containing the matches (up to K) for each column of the distance matrix, col is the index in A, row is the index in B of the match, and d is the distance between the two subsequences.

Return type:

List of tuple[int, int, float]