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

Isn't graph of Random Walk test set wrong? #3

Open
zfanswer opened this issue Dec 25, 2017 · 1 comment
Open

Isn't graph of Random Walk test set wrong? #3

zfanswer opened this issue Dec 25, 2017 · 1 comment

Comments

@zfanswer
Copy link

zfanswer commented Dec 25, 2017

In bolack in[13], ax1.plot(market_info[market_info['Date']>= split_date]['Date'].astype(datetime.datetime), market_info[(market_info['Date']+ datetime.timedelta(days=1))>= split_date]['bt_Close'].values[1:] * (1+bt_random_steps), label='Predicted')

Why choose to use values[1:] here? shouldn't it be values[:-1]?

use values[1:] then no meaning to get data 1 day before split_date by (market_info['Date']+ datetime.timedelta(days=1))>= split_date, [1:] will skip the first day, start apply random walk on actual_data(t), not actual_date(t-1).

@dashee87
Copy link
Owner

Apologies for the delay, I'm still getting through my Christmas backlog...

It wasn't immediately obvious to me why I went [1:], but it's actually because the dataframe is ordered by date in descending order. That's the default ordering on coinmarketcap. That means market_info[0] is actually the latest date, so we don't need to try to predict the day after it.

I think that resolves your issue. If not, please let me know!

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