Markov Transition FieldΒΆ

This example shows how you can transform a time series into a Markov Transition Field using pyts.image.MTF.

../_images/sphx_glr_plot_mtf_001.png
import numpy as np
import matplotlib.pyplot as plt
from pyts.image import MTF

# Parameters
n_samples, n_features = 100, 144

# Toy dataset
rng = np.random.RandomState(41)
X = rng.randn(n_samples, n_features)

# MTF transformation
image_size = 24
mtf = MTF(image_size)
X_mtf = mtf.fit_transform(X)

# Show the results for the first time series
plt.figure(figsize=(8, 8))
plt.imshow(X_mtf[0], cmap='rainbow', origin='lower')
plt.show()

Total running time of the script: ( 0 minutes 0.460 seconds)

Gallery generated by Sphinx-Gallery