Dataset organization with numpy arrays

Viewed 16

I'm working with a dataset with 5000 data points and I need some help organizing the data in numpyarrays. I need to investigate how many datapoints I should use to predict a value 7 steps further in the series, with the best accuracy. So I'm splitting the data in training set and validation set.

Naming k the number of samples I will consider in the prediction, I need to test k values until 50.

So my dataset is:

(array([[0.000e+00],
    [1.000e+00],
    [2.000e+00],
    ...,
    [4.247e+03],
    [4.248e+03],
    [4.249e+03]]),
 array([[0.188921  ],
    [0.19091041],
    [0.19443267],
    ...,
    [1.08557826],
    [1.0595874 ],
    [1.03426507]]))

And I tried this:

for k in range(0, 50):
for i in range(4249):
    globals()[f"x_{k+1}"] = x[i+k::1+k]
    globals()[f"y_{k+1}"] = y[7+k+i::1+k]

But what I get is only the last value of "i", for example, for x_1:

array([[4248.],
   [4249.]])

So, if anyone can help me, thank you so much in advance! :

0 Answers
Related