Time series tutorial: question to tensorflow data access

Time series forecasting  |  TensorFlow Core.

In the link above there is a tutorial for time series. Can someone explain me how to get access to the inputs, features and labels after creating the dataset. If I type w1 or w2.train I have only access to some example datasets and nothing more. I would like to know how can I access train inputs and labes, validation inputs and labes and test inputs and labels. Should I really have to creat a list? Can’t I access the w1.train values directly?

Hi @Cavour_Martinelli, In the tutorial the train, val, test datasets are in the form tf.data.Dataset, to see the data from tensorflow dataset you apply take method on the dataset. For example,

for inputs,label in w2.train.take(10):
  print(inputs)
  print(label) 

The above code will display the first 10 rows from the train dataset. Thank You.

1 Like

Hi @Kiran_Sai_Ramineni, thank you very much for you support. It worked.