Comments (6)
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.
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.
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.
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.
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.
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)
- Error with Forecaster Attribute 'validation_metric_value' HOT 2
- Return a dataframe for the forecasted future values HOT 3
- Prophet can't be found in grid.py HOT 8
- ForecastError: Need at least 1 Xvar to forecast with the svr model. HOT 3
- How to save model if I also used scalecast to find optimal transformation? HOT 6
- Got Tuple index out of range issue when calling manual_forecast() for rnn HOT 5
- Forecasting using Dates but also Categorical (Exgegenuous) Features HOT 1
- low-level output error generated RuntimeError: Detected a call to `Model.fit` inside a `tf.function`. `Model.fit is a high-level endpoint that manages its own `tf.function`. Please move the call to `Model.fit` outside of all enclosing `tf.function`s. Note that you can call a `Model` directly on `Tensor`s inside a `tf.function` like: `model(x)`. HOT 3
- Silencing Warning and printing HOT 7
- additional regressor for prophet does not work HOT 5
- Implement callbacks on the prophet model.
- Generating new dates / Frequency not understood HOT 9
- Data size impacting tune_test_forecast() and find_optimal_transformation() HOT 3
- `impute_lookback=None` does not work for default `fill_strategy='moving_seasonal_average'` HOT 1
- Forecasts with only Positive values HOT 1
- HWES estimator produces forecasts of much larger magnitude with statsforecast 1.5.0 HOT 2
- Xvars are not found in the current_xreg dict keys HOT 2
- scalecast starter example won't import on mac HOT 3
- Feature Imps not storing with Forecaster.tune_test_forecast HOT 3
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 scalecast.