tts.autoML | R Documentation |
h2o
provided by H2o.aiIt applies the h2o.autoML of H2O.ai to time series data.
tts.autoML(y,x=NULL,train.end,arOrder=2,xregOrder=0,type,max_models = 20,
sort_metric="AUTO",stopping_metric = "AUTO",initial=TRUE)
y |
The time series object of the target variable, for example, |
x |
The time series matrix of input variables, timestamp is the same as y, maybe null. |
train.end |
The end date of training data, must be specificed. The default dates of train.start and test.end are the start and the end of input data; and the test.start is the 1-period next of train.end. |
arOrder |
The autoregressive order of the target variable, which may be sequentially specifed like arOrder=1:5; or discontinuous lags like arOrder=c(1,3,5); zero is not allowed. |
xregOrder |
The distributed lag structure of the input variables, which may be sequentially specifed like xregOrder=1:5; or discontinuous lags like xregOrder=c(0,3,5); zero is allowed since contemporaneous correlation is allowed. |
type |
The time dummies variables. We have four selection: |
max_models |
Number of AutoML base models, default to 20. |
sort_metric |
Specifies the metric used to sort the Leaderboard by at the end of an AutoML run. Defaults to "AUTO", where 'AUC' (area under the ROC curve) for binary classification, 'mean_per_class_error' for multinomial classification, and 'deviance' for regression. Available options include:'MSE','RMSE','MAE','RMSLE','AUCPR' (area under the Precision-Recall curve) |
stopping_metric |
Specify the metric to use for early stopping. Defaults to "AUTO",where 'logloss' for classification and 'deviance' for regression. Besides, options are: 'MSE','RMSE','MAE','RMSLE','AUC','AUCPR','lift_top_group' |
initial |
Whether to initialize |
This function calls the h2o.automl function from package h2o
to execute automatic machine learning estimation.
output |
Output object generated by h2o.automl function of |
modelsUsed |
AutoML Leaderboard object, which is a table returns the argument of 'max_models'. |
arOrder |
The autoregressive order of the target variable used. |
dataused |
The data used by arOrder, xregOrder |
data |
The complete data structure |
TD |
Time dummies used, inherited from 'type' in tts.autoML |
train.end |
The same as the argument in tts.caret |
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
# Computation takes time, example below is commented.
data("macrodata")
dep<-macrodata[,"unrate",drop=FALSE]
ind<-macrodata[,-1,drop=FALSE]
# Choosing the dates of training and testing data
train.end<-"2008-12-01"
#autoML of H2O.ai must execute the commands below
#h2o::h2o.init() # Initialize h2o
#invisible(h2o::h2o.no_progress()) # Turn off progress bars
# autoML <- tts.autoML(y=dep, x=ind, train.end,arOrder=c(2,4),
# xregOrder=c(0,1,3),type="both",initial=FALSE)
# print(autoML$modelsUsed,n=22) #View the AutoML Leaderboard
#testData2 <- window(autoML$dataused,start="2009-01-01",end=end(autoML$dataused))
#P1<-iForecast(Model=autoML,Type="static",newdata=testData2)
#P2<-iForecast(Model=autoML,Type="dynamic",n.ahead=nrow(testData2))
#tail(cbind(testData2[,1],P1))
#tail(cbind(testData2[,1],P2))
#h2o::h2o.shutdown(promp=FALSE) # Remember to shutdown h2o when all works are finished.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.