I have trained and cross-validated an xgboost classification algorithm in R using the following code:
xgb_params <- list("objective" = "binary:logistic",
"eval_metric" = "error",
min_child_weight=1,
subsample=1,
colsample_bytree= 0.6,
eta = 0.05,
gamma = 1,
max_depth = 5
)
watchlist <- list(train = train_matrix, test = test_matrix)
xgb_mod <- xgb.train(params = xgb_params,
data = train_matrix,
nrounds = 800,
watchlist = watchlist,
seed = 333)
xgb_mod
Now I want to do one-step-ahead forecasting.
However, using the following:
xgbpred_prob <- predict(xgb_mod, newdata = test_matrix)
it is required some new data to be stored into a matrix. Instead, I wish to do forecasting like the following code would do for an ARIMA model:
fit <- arima(df, order = c(0,1,1))
predict(fit, n.ahead = 6)
It is like if the first part of the job which I have done was to validate the booster, instead now I wish to put the model into production mode and use it on a daily basis for daily forecasting.
Do you have any idea how could I achieve that?