distancematrix.consumer.distance_matrix
¶
Module Contents¶
Classes¶
Helper class that provides a standard way to create an ABC using |
- class distancematrix.consumer.distance_matrix.DistanceMatrix¶
Bases:
distancematrix.consumer.abstract_consumer.AbstractStreamingConsumer
Helper class that provides a standard way to create an ABC using inheritance.
- initialise(self, dims, query_subseq, series_subseq)¶
Initialise this consumer.
- Parameters
dims – the number of dimensions (data channels) this consumer will receive
query_subseq – the number of query subsequences (rows in the distance matrix)
series_subseq – the number of series subsequences (column in the distance matrix)
- Returns
None
- process_diagonal(self, diagonal_index, values)¶
Method called when a diagonal of the distance matrix is calculated.
The number of values on the diagonal might be less than the diagonal of the full matrix profile, this can occur when not enough data is available yet to calculate the entire distance matrix (typically for streaming when not enough data is available to fill the entire foreseen space).
- Parameters
diagonal_index – index of the diagonal in range ]-num_query_subseq, num_series_subseq[, the main diagonal has index 0
values – array of shape (num_dimensions, num_values_on_diagonal) containing the distances
- Returns
None
- process_column(self, column_index, values)¶
Method called when a column of the distance matrix is calculated.
The number of values on the column might be less than the column of the full matrix profile, this can occur when not enough data is available yet to calculate the entire distance matrix (typically for streaming when not enough data is available to fill the entire foreseen space).
- Parameters
column_index – index of the column, in range [0, series_subseq[
values – array of shape (num_dimensions, num_values_on_column) containing the distances
- Returns
None
- shift_series(self, amount)¶
Inform the consumer that the distance matrix has shifted in the series direction.
- Parameters
amount – amount of subsequences that were shifted
- Returns
None
- shift_query(self, amount)¶
Inform the consumer that the distance matrix has shifted in the query direction.
- Parameters
amount – amount of subsequences that were shifted
- Returns
None