Working with the Matrix Profile
In this section, as well as the next one, we will work with the stumpy
Python package. This package is not related to iSAX but offers lots of advanced functionality related to time series. With the help of stumpy
, we can calculate the Matrix Profile.
The Matrix Profile is two things:
- A vector of distances that shows the distance of each subsequence in a time series to its nearest neighbor
- A vector of indexes that shows the index of the nearest neighbor of each subsequence in a time series
The Matrix Profile can be used in many time series mining tasks. The main reason for presenting it is to understand that working with time series can be slow, so we need structures and techniques to improve the performance of time series-related tasks.
To get a better idea of the use of the Matrix Profile and the time it takes stumpy
to calculate the Matrix Profile, here is the Python code of matrix_profile.py
:
#!/usr/bin/env python3 import...