johannfaouzi / pyts

A Python package for time series classification

Home Page:https://pyts.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'RecurrencePlots' from 'pyts.image'

impvd opened this issue · comments

Description

Got error when import this lib

Steps/Code to Reproduce

Just using pip3 install pyts to install this lib, an get the following error:

$ python3
Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyts.image import RecurrencePlots
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'RecurrencePlots' from 'pyts.image' (/usr/local/lib/python3.8/site-packages/pyts/image/__init__.py)

Versions

NumPy 1.18.1
SciPy 1.5.2
Scikit-Learn 0.23.2
Numba 0.51.2
Pyts 0.11.0

Cool, thanks @johannfaouzi

I got code from your github.io, it seems that we might need to update the docs:)

import numpy as np
import matplotlib.pyplot as plt
from pyts.image import RecurrencePlots

# Parameters
n_samples, n_features = 100, 144

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

# Recurrence plot transformation
rp = RecurrencePlots(dimension=1,
                     epsilon='percentage_points',
                     percentage=30)
X_rp = rp.fit_transform(X)

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

Thanks for the report! We use readthedocs now (https://pyts.readthedocs.io/en/stable/index.html) and have been for a while actually. I should delete the doc on my github.io to remove any confusion.