convert time series data set to supervised for deep learining

I have dataset like

so I want to use that for prediction of time series with deep learning. I have this function to make it supervised

def to_supervised(train,n_input,n_out):
#falten data
data=train
X,y=list(),list()
in_start=0
for _ in range(len(data)):
    in_end=in_start+ n_input
    out_end=in_end + n_out
    if out_end=len(data):
        x_input=data[ in_start:in_end,0]
        x_input=x_input.reshape((len(x_input)))
        X.append(x_input)
        y.append(data[in_end:out_end,0])
    in_start+=1
return array(X), array(y)

I am not sure about functionality of this function. Do you have replacemment for this function?

Topic dataset

Category Data Science


According to our comments, your objective is to "predict any issued according to the previous issues"

The best way to include time series data in such a dataset is to include variable crawling through the past dates.

For example :

  • Value of the latest known records
  • Value of the 7 latest known records
  • Variance of the 7 latest known records
  • Min, Max, etc

Example : If you want to predict in 2022-06-01, you only know data before this date, so creating variables taking past information like that can be a good idea. The biggest problem will be adapting your period to your problem (is there any gain in information if you look a few years before ?) and to handle your first cases (what do you put in the variable "Value of the 7 latest known 'issues'" if you only know 2 past records for example).

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.