How to pad real-valued sequences

How to pad real-valued sequences

Manage alerts

Loading saved threads...

Aechlys · External communityPost link
External question — Data Science Stack Exchange Author: Aechlys Original post: https://datascience.stackexchange.com/questions/29348 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have several sequences of arbitrary univariate time-series data (not related to one specific domain, unbounded range). The sequences are of different lengths and right now I cannot batch them and feed them to a network. What is the correct procedure to pad these sequences? Is it even possible in this case since I can't use any number as a special symbol? To give example of one such series, consider standardized stock dataset (only first 10 elements shown): d = array([-0.37807043, 0.14321786, -0.37807043, 0.13478392, 0.18733381, 1.19576774, 0.25675156, 0.26064414, 0.30930144, 0.38650436])
Quote
Report
Paul Childs · External communityPost link
External answer — Data Science Stack Exchange Author: Paul Childs Original post: https://datascience.stackexchange.com/a/29353 License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/ Adaptation: HTML converted to plain text; contact email addresses removed. How you pad it (and even whether you do so) would depend on what you expect of the data. This imposes boundary conditions on the data which will induce artifacts in any transform you make. How bad this effect depends on how well geared your data is to accepting a particular padding method. Padding methods include zero padding or a periodic bound. Padding doesn't have to be done in the time domain. Eg interpolating in the frequency domain and back transforming allows you to extrapolate. If your analytics has a finite history (eg FIR filters) then you can isolate time regions where padding is unnecessary and draw comparisons therefrom.
Quote
Report
Aramakus · External communityPost link
External answer — Data Science Stack Exchange Author: Aramakus Original post: https://datascience.stackexchange.com/a/110640 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. If I understand you correctly, you have several univariate time series, that you want to stack into a multi-variate one, but cannot do so because they have different length. I think you might find this guide on masking and padding to be a useful starting point. In your case I think masking is a must have as you will have batches when one or more series needs to be padded. An alternative is to train an imputer model first, to impute missing time series from those that are left.
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External answer — Data Science Stack Exchange Author: Aramakus Source score (net votes, not local likes): 0 Original post: https://datascience.stackexchange.com/a/110640 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. If I understand you correctly, you have several univariate time series, that you want to stack into a multi-variate one, but cannot do so because they have different length. I think you might find this guide on masking and padding to be a useful starting point. In your case I think masking is a must have as you will have batches when one or more series needs to be padded. An alternative is to train an imputer model first, to impute missing time series from those that are left.

Cancel quote

Checking account access…