Comments (4)
Hey @avocardio , these issues comes from my other module TimeSeriesCrossValidation. And this means that the data you are using to train these models (or "fit" in case of the regressions) is not enough given your number of inputs and number of outputs.
For instance, imagine that you want to predict the share price of Monday using the stock prices of this last week (5 days). You will define the number of outputs to be 1 because you only want to predict 1 share price, and the number of inputs of 5 because you want to use the data of the 5 previous consecutive days.
If when you load the model, you select a starting date -s that starts last week, you won't be able to train because you are using the data that you would be effectively using for prediction. Meaning that you probably need to set that starting date -s for a value more in the past so that you can use that data for training/fitting your model.
Let me know if this makes sense.
TL;DR: Set the starting date flag -s with a value further in the past
from openbbterminal.
Makes perfect sense @DidierRLopes , thank you so much. What would be a good time frame for the preds in your opinion? The errors above came from a timeframe starting 2021-01-01.
from openbbterminal.
No worries, always happy to help.
Yea that makes sense, by default the algorithm has -i 40
which expects 40 data points. If you are using daily data, this corresponds to 2 months.
There isn't a "right" time frame to use, there are several things that you need to do in order to have one of the Neural Networks optimized for your stock price. Here are some things to look at when doing this:
- First of all I'd say for you to look at the entire historical data of a stock and try to understand since when up till now the stock has behaved rather similarly. I.e. if you look into the historical data of 20 years ago, probably the stock price didn't move much. So I'd avoid training a model with this.
- You have to set the training days that you want. Note that that if -i is 40 you are using 40/5= 8 weeks of data = 2 months.
- You have to set the prediction days, here I'd recommend to set it to 1. As predicting further down in the future is much more complicated, because you have a much larger range to "deviate" from the last valid stock price, if it makes sense
- You have the model that you want to chose. The models defined per default don't have any guarantees, I just made sure they ran fine, tested a few different ones, and left it like that. Each user must tune it's NN for the stock they want. When I come to implementing #5 this will be great as it will allow you to "validate" your model. You're gonna be able to test on this past data how your model would work out. And I already have a great idea on how to make this work smoothly, can't wait to implement this.
- This validation is important because it allows you to set not only your model, but number of training epochs, if data is pre-processed, the optimizer in use, the type of loss function.
Seriously, there's just so much to it. That's the beauty of it.
PS: One thing you can do if you want to not "lose" too much time, is research "successful" papers on stock prediction that disclose how they implemented certain NN (most likely LSTM since this one has a "notion" of time) and just implement it, as the code is written in a way that is really easy to configure a neural network to your own taste!
from openbbterminal.
Thanks for the nice explanation, I really appreciate what you're doing with this !
from openbbterminal.
Related Issues (20)
- [IMPROVE] HOT 1
- [Bug] - IntrinioInsiderTradingData: underlying_shares - Input should be a valid integer, got a number with a fractional part
- [Bug] [Rest API]: Literal error when a comma-separated list of countries is used.
- `news` command doesn't work as documented
- Want to access a running openBBTerminal container running on my local server through a web browser HOT 3
- [Bug] 3D Volatility Surface -- axes are off HOT 1
- [Bug] Receiving TypeError after login HOT 2
- [IMPROVE] News feature needs to improve make sure the news is about the stocks and not random news. HOT 1
- CAPM code returns error HOT 5
- [Bug] Blank charts HOT 8
- [Bug] Cannot search for a term with spaces in it in the funds menu of OpenBB Terminal
- [Bug] obb.fixedincome.government.treasury_rates(): Federal Reserve website error - We're sorry, but an unhandled error has occurred. HOT 1
- [Bug] No historical price data with yfinance HOT 9
- [FR]: Historical EPS data from AlphaVantage
- [FR] Source Support
- Copper to Gold Ratio Example
- [FR] - add provider for yfinance-cache HOT 2
- [Bug] Installing openbb-core also installs ruff, prevents upgrade to ">=0.2.0 HOT 2
- [IMPROVE] DCF Calculations
- [Bug] TypeError returned when attempting to import OpenBB in Jupyter Notebook HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openbbterminal.