Giter Site home page Giter Site logo

Comments (10)

elephaint avatar elephaint commented on August 20, 2024 1

@elephaint but I would like to do the following:

  • Fit the model on training data
  • Predict h steps after a given input sequence other than the training period (which I was assuming was the role of X_df)

How can I supply an unseen input sequence to the model and get it to predict the next sequence?

In an ARIMA model, we train on [x_t, x_{t+1}, ...., x_{t + T}] for a particular time series. We can then make predictions for that series only, for an arbitrary long period following x_{t + T} (by setting the horizon in our predict function). We can optionally add exogenous variables during training, and during the prediction period (the latter by including them in X_df for all dates in your forecasting horizon).

You can't 'supply an unseen input sequence' to an ARIMA model. If you have an unseen input sequence, you would normally train an ARIMA model on that unseen input sequence, and subsequently create forecasts for a horizon using that newly trained model. Each new time series requires a new ARIMA model.

from statsforecast.

Vitorbnc avatar Vitorbnc commented on August 20, 2024

Actually the quick fix expected_shape = (h * len(self.ga), self.ga.data.shape[1] + 2) gets rid of the error but the predictions won't update if passing a different slice of the dataframe in X_df

from statsforecast.

jmoralez avatar jmoralez commented on August 20, 2024

Hey. The X_df argument is for future values of exogenous features and you don't have any, so you don't need to provide it.

from statsforecast.

Vitorbnc avatar Vitorbnc commented on August 20, 2024

@jmoralez so what is the correct way to predict future values for some input other than the training dataframe?

from statsforecast.

elephaint avatar elephaint commented on August 20, 2024

@Vitorbnc You can just run predict(h=12, level=[90]). That will give you the predictions for the timeperiod following the training period.

from statsforecast.

Vitorbnc avatar Vitorbnc commented on August 20, 2024

@elephaint but I would like to do the following:

  • Fit the model on training data
  • Predict h steps after a given input sequence other than the training period (which I was assuming was the role of X_df)

How can I supply an unseen input sequence to the model and get it to predict the next sequence?

from statsforecast.

Vitorbnc avatar Vitorbnc commented on August 20, 2024

@elephaint ok then, that makes sense. Thanks for the explanation. I am trying to do the same with mlforecast, but I am getting a different error:

image

I am sure there is no NaN neither in the train nor the test dataframes though

from statsforecast.

elephaint avatar elephaint commented on August 20, 2024

Thanks - it's very hard to debug based on this picture only. Can you share a minimal working example of your code?

Based on the picture I can only suggest to double check the existence of NaN in train_df.

Note that you are training and testing on the same timestamps - I assume that is on purpose (as it's something that you'd want to avoid normally in forecasting)? I.e. you're supplying the full train_df as training set, and use a subset of train_df as test set. Hence, any test results you get will not be representative for the actual forecasting performance. I.e. normally one would do something like this:

train_df = df[:-12]
test_df = df[-12:]

in order to properly separate train- and test sets.

from statsforecast.

Related Issues (20)

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.