Skip to main content

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.

Illustration

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.

Source Distribution

ts2pi-0.1.4.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

ts2pi-0.1.4-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page