Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the RL algorithms, why label in training set is at t+2 while which in validate set is at time t+1 ? #21

Closed
xtyangjie opened this issue Jun 29, 2018 · 2 comments

Comments

@xtyangjie
Copy link

xtyangjie commented Jun 29, 2018

As asked in the title, in base/env/market.py, when generating sequences from orignal dataset, the label of training set is at time of t+2(data_index + 1) compared to x(from data_index - seq_len to data_index, a semi-closed interval), while when choosing label for the validate set, it is at t+1 instead.

Note that there is a tiny bug in master in the statement of instruments_y assiginment and I fixed in according to the code in dev branch.

`
if date_index < self.bound_index:

    # Get y, y is not at date index, but plus 1. (Training Set)

    instruments_y = scaled_frame.iloc[date_index + 1]['close']

else:

    # Get y, y is at date index. (Test Set)

    instruments_y = scaled_frame.iloc[date_index]['close'] # data_index + 1 --> data_index here

`

Thanks for your answer :)

@xtyangjie
Copy link
Author

In addition, I had post an email to @Ceruleanacg before, while it may be a better approach to send the question here (to make a record). It could help owners to collect information about my question, too.

Another question in the mail is posted in the next issue seperately.

@xtyangjie xtyangjie changed the title Two questions: In the RL In the RL algorithms, why label in training set is at t+2 while which in validate set is at time t+1 ? Jun 29, 2018
@Ceruleanacg
Copy link
Owner

We had a talk in WeChat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants