You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you feel about an OO to the API instead of using strings and if statements to specify the model? It might provide greater flexibility and cleaner code.
library(forecast)
library(forecastHybrid)
some_ts<- ts(1:144, frequency=12)
model_1<-forecast::stlf(some_ts)
model_2<-forecast::ets(some_ts)
model_3<-forecast::auto.arima(some_ts)
model_4<-forecast::nnetar(some_ts)
ensembled_model<-forecastHybrid::hybridModel(model_1, model_2, model_3, model_4, ...) # other args
class(ensembled_model) # "forecast" "ensemble"# other API calls consistent with forecast, e.g.
plot(forecast(ensembled_model, h=14))
hybridModel<-function(models, ...) {
for (modelinmodels) {
# code that fits and finds weights and ensembles
}
return(ensembled_model)
}
forecastHybrid::hybridModel auto-magically finds weights and returns an object of class c("forecast", "ensemble") that is consistent with all the other functions in the forecast package.
The text was updated successfully, but these errors were encountered:
This might cause some additional headaches when it comes time to implement parallelization. I'm planning to implement parallelization both between and within models (e.g. on a 6-core machine auto.arima runs with two cores, tbats with 2 cores, and ets with one, and nnetar with one. They are all called using foreach). This would involve lots of testing and tweaks to compare the average runtime of auto.arima/nnetar/ets/tbats/stlm models so that a relatively optimal parallelization strategy can be selected and the overall ensemble takes about as long as the slowest individual model. Custom models make this difficult. We'll also need to consider whether the custom models need a forecast() or also would work with a predict() method. Lots to consider, but I like the idea.
How do you feel about an OO to the API instead of using strings and if statements to specify the model? It might provide greater flexibility and cleaner code.
forecastHybrid::hybridModel
auto-magically finds weights and returns an object of classc("forecast", "ensemble")
that is consistent with all the other functions in the forecast package.The text was updated successfully, but these errors were encountered: