nredell / forecastML

An R package with Python support for multi-step-ahead forecasting with machine learning and deep learning algorithms
Other
130 stars 23 forks source link

Combining horizon-specific forecasts #20

Closed nredell closed 4 years ago

nredell commented 4 years ago

I have forecasting examples that go 98% of the way. The last 2% would be combining the horizon-specific models into a single forecast. It's easy enough to do manually with the data.frame from predict(..., data = data_forecast), but there really needs to be a function that takes that data.frame and produces a single forecast when multiple models have been trained in one go.

One simple and maybe default approach would be that, for example, if a 1:3 and 1:12 horizon model were trained side by side, the first 1- to 3-steps ahead would come from the 1:3 model and steps 4 through 12 would come from the 1:12 model. In the spirit of this package, though, people will still have the freedom to combine short- and long-term forecast models as they see fit.

Let's call this one forecastML::combine_forecasts().

nredell commented 4 years ago

This is now halfway implemented with combine_forecasts() and plot.forecastML(): completed for non-grouped numeric and factor level outcomes. The next step will be to make this function and plot work with predicted class probabilities. We'll tackle grouped data after that.

nredell commented 4 years ago

I think we're there. There may be some corner cases additional formatting needed, but those will be addressed in unit testing and a refactor of the, now extensive, plotting code into a handful of plotting functions.

A new issue will be opened for automatically selecting the optimal forecast combinations based on nested cross-validation error.