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

For the images part, it seems to accept same width and height of images (ex: 32*32) and not different width and height (ex: 32*39). Any fix? #67

Open
zneha opened this issue Mar 4, 2020 · 12 comments

Comments

@zneha
Copy link

zneha commented Mar 4, 2020

Description

Steps/Code to Reproduce

<< your code here >>

Versions

@johannfaouzi
Copy link
Owner

Are you talking about the algorithms in the pyts.image module? For all of them it does not make much sense to have different width and height, since the idea overall is to get some information between time points: f(x_i, x_j).

@zneha
Copy link
Author

zneha commented Mar 5, 2020 via email

@johannfaouzi
Copy link
Owner

If you give a float between 0 and 1, the size of the image will be proportional to the length of your time series.

So if you set image_size=p, the size of the image will be (ceil(p * length), ceil(p * length)).

With p=0.5 for instance, it would give:

  • ceil(0.5 * 1225) = 613
  • ceil(0.5 * 1248) = 624

@zneha
Copy link
Author

zneha commented Mar 5, 2020 via email

@johannfaouzi
Copy link
Owner

I don't understand why you want different values as it does not make sense.

If you really want different width and height, just set image_size to the larger value (39), you will get an image with shape (39, 39) and you can crop / downsample this image so that its new shape is (32, 39).

@zneha
Copy link
Author

zneha commented Mar 5, 2020 via email

@zneha
Copy link
Author

zneha commented Mar 5, 2020 via email

@johannfaouzi
Copy link
Owner

The thing is that there is no relationship of this kind. If you want to transform your 1D-time series into an 2D-array without performing in any modification of the values, you can use numpy.reshape. But it is totally different from what the algorithms in the pyts.image module do.

@zneha
Copy link
Author

zneha commented Mar 5, 2020

Is it not that, this entire module is to convert a time series to a matrix (image esentially)?

@johannfaouzi
Copy link
Owner

Yes, and the image will always be a square matrix.

@zneha
Copy link
Author

zneha commented Mar 5, 2020 via email

@johannfaouzi
Copy link
Owner

No.

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