Hello, when I checked the code of stock_data_handle.py, I got confused about the __getitem__ function of class DatasetStock_PRED because in the code you index the self.label with index instead of position, and I don't know why. I think it may lead to the return ratio generated from the first and second/ fifth day in seq_x being mistaken for the return ratio of the first and second/ fifth day in the future.
To prove what I found, I run sh train_pred_long.sh as an example and add some codes in the train funtion of Exp_pred in exp_pred.py as shown in the image below:
It seems that the variable c which is a return ratio simply calculated from batch_x1 is exactly the same as batch_y. So I think in the code, there is an alignment problem between the training features and the labels
Is this a mistake? If what I found is True, it will make the training process unreliable and may affect the conclusion. Could anyone help me? Thanks!
Hello, when I checked the code of
stock_data_handle.py
, I got confused about the__getitem__
function ofclass DatasetStock_PRED
because in the code you index theself.label
withindex
instead ofposition
, and I don't know why. I think it may lead to the return ratio generated from the first and second/ fifth day inseq_x
being mistaken for the return ratio of the first and second/ fifth day in the future.To prove what I found, I run
sh train_pred_long.sh
as an example and add some codes in thetrain
funtion ofExp_pred
inexp_pred.py
as shown in the image below:It seems that the variable
c
which is a return ratio simply calculated frombatch_x1
is exactly the same asbatch_y
. So I think in the code, there is an alignment problem between the training features and the labelsIs this a mistake? If what I found is True, it will make the training process unreliable and may affect the conclusion. Could anyone help me? Thanks!