szhan / pyrqa

Recurrence Quantification Analysis of Large-Scale Time Series
Apache License 2.0
29 stars 8 forks source link

Example code doesn't work #6

Open lngdet opened 4 months ago

lngdet commented 4 months ago

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 commented 1 month ago

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)