Code Monkey home page Code Monkey logo

Comments (1)

dhopp1 avatar dhopp1 commented on May 30, 2024 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.