Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code doesn't work #6

Open
lngdet opened this issue Jun 14, 2024 · 1 comment
Open

Example code doesn't work #6

lngdet opened this issue Jun 14, 2024 · 1 comment

Comments

@lngdet
Copy link

lngdet commented Jun 14, 2024

Whey I run the exact code given under the Usage section of the README (see below), i get an error:

>>> from pyrqa.settings import Settings
>>> from pyrqa.neighbourhood import FixedRadius
>>> from pyrqa.metric import EuclideanMetric
>>> from pyrqa.computation import RQAComputation
>>> time_series = [0.1, 0.5, 0.3, 1.7, 0.8, 2.4, 0.6, 1.2, 1.4, 2.1, 0.8]
>>> settings = Settings(time_series,
                        embedding_dimension=3,
                        time_delay=1,
                        neighbourhood=FixedRadius(1.0),
                        similarity_measure=EuclideanMetric,
                        theiler_corrector=1,
                        min_diagonal_line_length=2,
                        min_vertical_line_length=2,
                        min_white_vertical_line_length=2)
>>> computation = RQAComputation.create(settings, verbose=True)
>>> result = computation.run()
>>> print result

I get this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[137], line 1
----> 1 settings = Settings(time_series,
      2                         embedding_dimension=3,
      3                         time_delay=1,
      4                         neighbourhood=FixedRadius(1.0),
      5                         similarity_measure=EuclideanMetric,
      6                         theiler_corrector=1,
      7                         min_diagonal_line_length=2,
      8                         min_vertical_line_length=2,
      9                         min_white_vertical_line_length=2)

TypeError: Settings.__init__() got an unexpected keyword argument 'embedding_dimension'

The version of pyrqa i'm using is: 8.1.0, installed using pip install pyrqa==8.1.0

@suvodip1212
Copy link

from pyrqa.time_series import TimeSeries
from pyrqa.settings import Settings
from pyrqa.analysis_type import Classic
from pyrqa.neighbourhood import FixedRadius
from pyrqa.metric import EuclideanMetric
from pyrqa.computation import RQAComputation
data_points = [0.1, 0.5, 1.3, 0.7, 0.8, 1.4, 1.6, 1.2, 0.4, 1.1, 0.8, 0.2, 1.3]
time_series = TimeSeries(data_points,
embedding_dimension=2,
time_delay=2)
settings = Settings(time_series,
analysis_type=Classic,
neighbourhood=FixedRadius(0.65),
similarity_measure=EuclideanMetric,
theiler_corrector=1)
computation = RQAComputation.create(settings,
verbose=True)
result = computation.run()
result.min_diagonal_line_length = 2
result.min_vertical_line_length = 2
result.min_white_vertical_line_length = 2
print(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants