Git Product home page Git Product logo

Comments (6)

mikekeith52 avatar mikekeith52 commented on May 18, 2024

Hi, you don't need actual y values. You need historical data to train the models on, but the predictions over the unknown forecast horizon only use the Xvars you pass to the model. So for your data, calling f.export('lvl_fcsts') should give you the forecasted points over the next four periods.

from scalecast.

fstayco avatar fstayco commented on May 18, 2024

Thanks heaps for clarifying and for your patience. Related to the code that you previously shared, suppose f2 contains more recent data in addition to the one used in f1, would it be equivalent to getting predictions over the new unknown forecast horizon based on the original model?

from scalecast.Forecaster import Forecaster
from scalecast.util import find_optimal_transformation
 
f1 = Forecaster(...)
f2 = Forecaster(...)

f1.add_ar_terms(12)
f2.add_ar_terms(12)
 
# find optimal transformation on series 1
transformer, reverter = find_optimal_transformation(f1)
f1 = transformer.fit_transform(f1)
 
# tune lasso model on series 1
f1.set_estimator('lasso')
f1.tune()
chosen_params = f1.best_params # save best params -- these will also be in f1.history['lasso']['HyperParams']
f1.auto_forecast()
 
# apply transformation to series 2
f2 = transformer.fit_transform(f2)

# apply lasso model with optimal hyperparams to series 2
f2.set_estimator('lasso')
f2.manual_forecast(**chosen_params)

from scalecast.

mikekeith52 avatar mikekeith52 commented on May 18, 2024

Oh, I think I know what you are asking. One of the nuances with scalecast is that models have to retrain every time predictions are generated. To do what you are describing, you can use f.export_Xvars_df() to see the actual utilized regressors in the model and then f.history[model_nickname]['regr'] to get the scikit-learn regression model to make predictions with. It would be somewhat manual. It would also be very difficult to incorporate transformations. Maybe a good future enhancement would be making that easier. But typically, for what I need time series forecasting for, I always want to retrain the model with the most recent known observations, which is my thinking behind the current scalecast functionality.

from scalecast.

fstayco avatar fstayco commented on May 18, 2024

For our specific use-case, we need to be able to monitor model drift. With regard the work around, may I request for a code snippet of how I may implement it?

from scalecast.

mikekeith52 avatar mikekeith52 commented on May 18, 2024

Sure, I'll start working on mocking something up. One potentially easier work around would be to iteratively try longer and longer forecast horizons. As long as you know the actuals, the model predictions wouldn't change even if you used shorter horizons but didn't retrain the model.

from scalecast.

mikekeith52 avatar mikekeith52 commented on May 18, 2024

Instead of code, I decided to build a method for the Forecaster object that can be used for what you are describing. Please see the notebook for an example of how to apply it. Right now, only sklearn univariate is available for this process but I am planning to implement this for all model types so let me know if there is one that you would prefer to be implemented next.

from scalecast.

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.