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

Decision Tree和Random Forest感觉有问题 #2

Open
Zion-Z opened this issue Nov 26, 2020 · 1 comment
Open

Decision Tree和Random Forest感觉有问题 #2

Zion-Z opened this issue Nov 26, 2020 · 1 comment

Comments

@Zion-Z
Copy link

Zion-Z commented Nov 26, 2020

小白提问。
代码是根据当天的开盘、收盘、最高价来预测当天的涨跌,这不能其预测第二天涨跌的效果,所以加入当天的p_change, price_change后train datatset和test dataset预测准确性变成了1。
应当把 self.tsData["(t+1)-(t)"] = self.tsData['close'] - self.tsData['close'].shift(-1) 改为
self.tsData["(t+1)-(t)"] = self.tsData['close'].shift(1) - self.tsData['close']

@moyuweiqing
Copy link
Owner

我重新看了一下,的确应该是self.tsData["(t+1)-(t)"] = self.tsData['close'].shift(1) - self.tsData['close'],这样子的value值才是预测第二天的涨跌情况。原来的那句代码是当天相对于第二天的涨跌情况的确不正确,感谢指正

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