Python module to transform a time series into a persistence image representation
Project description
Time Series to Persistence Image
Little module to transform a time series into a persistence image.
Can be used to convert an arbitrarily long time series into a fixed size representation that embed topological information about the signal.
Quickstart
Install with pip install ts2pi
and use the function this way:
from ts2pi import persistence_image
im = persistence_image([1,4.3,3,5.1,1.5]) # numpy array of shape (40,40)
Overview
You might need to change the default values of the function parameters, because they highly depend on the time series you are manipulating.
from ts2pi import persistence_image
import matplotlib.pyplot as plt
l = [1,4.3,3,5.1,1.5]
im = persistence_image(l, resolution=[40,40], t=3, bandwidth=0.1) # numpy array of shape <resolution>
plt.imshow(im)
Try changing the values of t
and bandwidth
and see how it looks. Ideally, you could expect to see several patches on the image, like in the example above.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.