Comments (1)
Hi, what you would need to do is set your data up like this:
date, feature_1, .... , feature_n, target
01.01.2023, x, ..., x, NA
02.01.2023, x, ..., x, NA
03.01.2023, x, ..., x, ΝΑ
...
31.01.2023, x, ..., x, y
01.02.2023, x, ..., x, NA
...
28.02.2023, x, ..., x, y
And so on. So the monthly target values go in the last day of the month, with NAs in the intervening days.
Then the n_timesteps
parameter of the function will dictate how many days trailing to train the model on. E.g., if you set n_timesteps
to 30
, the prediction for January 2024 will use the daily data from 02.01.2024-31.01.2024 to predict the value for January. Set it to 60
if you want it to predict based on December and January's numbers. You will have to find the best number using hyperparameter tuning and out of sample testing.
One thing to note is the library is focused on nowcasting rather than forecasting. So in your example, it will work (though I don't know how well) for predicting January 2024 as long as the n_timesteps
is long enough to encapsulate some actual data that has been published. E.g., a value of 90
will have some published data and thus will predict something other than the mean. If it's 30
, it wouldn't start to produce non-mean predictions until we're in January.
The last thing to note is if you want predictions for January, make sure your dataframe has January's dates in it. Your data as it currently looks might only go to 20.11.2023, so it will only create predictions up until that date. Add the dates up to 31.01.2024 (with just NAs for all the values) and that will produce predictions for January as well.
from nowcast_lstm.
Related Issues (12)
- No module named 'pmdarima' HOT 3
- Lag of Target Variable HOT 1
- ModuleNotFoundError: No module named 'nowcast_lstm.LSTM'; 'nowcast_lstm' is not a package HOT 6
- ARDL and LSTM HOT 1
- list index out of range
- missing values in mix frequencies data HOT 7
- criterion requirement HOT 4
- Early stop to prevent overfitting HOT 2
- Code error help HOT 1
- evaluation and accuracy of model. HOT 1
- LSTM model parameters HOT 1
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 nowcast_lstm.