Section 4 Unit 14- LSTM training set is performed using a 2-day look ahead, as opposed to 1-day

Please refer to the Dropbox link for the PDF and 4 steps screenshots I followed to arrive to my conclusions.



Context: It is mentioned in this notebook that a 1-day look ahead will be used for future predictions. When digging the code, it appears that the y_train has been shifted twice during the Data-Preprocessing, training the model on a 2-day look ahead predictions.



Question:

1- Please confirm this Notebook is, in fact, using a 2-day look ahead to train the model. 

2- Please confirm what is the correct code to Pre-process datas using only 1-day look ahead

      (I would say simply do not shift(-1) the data when creating  "y" : In[4] y=data.Last.shift(-1) , please confirm if my understanding is correct)



In summary:



This can be seen when printing X_train[0], which refers to the data on date:  2015-01-01 while printing y_train[0] refers to the data of 2015-01-05 , which is 2 trading days in the future, not 1. 





Please ensure you can view the PDF link of the dropbox as it includes screenshots and explanation



Thank you for your help,

Julien 

Hello Julien,



Will answer your questions sequentially:



"Please confirm this Notebook is, in fact, using a 2-day look ahead to train the model." - there is only one statement in the entire code that shifts the data. The shift is only for one bar or day. 



"Please confirm what is the correct code to Pre-process datas using only 1-day look ahead

      (I would say simply do not shift(-1) the data when creating  "y" : In[4] y=data.Last.shift(-1) , please confirm if my understanding is correct)" - Yes, that is the correct code for shifting the data "back" by one day.



"
This can be seen when printing X_train[0], which refers to the data on date:  2015-01-01 while printing y_train[0] refers to the data of 2015-01-05 , which is 2 trading days in the future, not 1." - I can confirm that right before training, the y_train shows values from one day ahead. 



I am not able to access the dropbox link.