To answer your question in a more general term, it is possible to use machine learning and predict h-steps-ahead forecasts. The tricky part is that you have to reshape your data into a matrix in which you have, for each observation the actual value of the observation and past values of the time series for a defined range. You will need to define manually what is the range of data that appear relevant to predict your time series, in fact, as you would parameter an ARIMA model. The width/horizon of the matrix is critical to predict correctly the next value taken by your matrix. If your horizon is restricted, you might miss seasonality effects.
Once you have done that, to predict h-steps-ahead, you will need to predict the first next value based on your last observation. You will then have to store the prediction as an "actual value", which will be used to predict the second next value through a time shifting, just like an ARIMA model. You will have to iterate the process h times to get your h-steps-ahead. Each iteration will rely on the previous prediction.
An example using R code would be the following one.
library(forecast)
library(randomForest)
# create a daily pattern with random variations
myts <- ts(rep(c(5,6,7,8,11,13,14,15,16,15,14,17,13,12,15,13,12,12,11,10,9,8,7,6), 10)*runif(120,0.8,1.2), freq = 24)
myts_forecast <- forecast(myts, h = 24) # predict the time-series using ets + stl techniques
pred1 <- c(myts, myts_forecast1$mean) # store the prediction
# transform these observations into a matrix with the last 24 past values
idx <- c(1:24)
designmat <- data.frame(lapply(idx, function(x) myts[x:(215+x)])) # create a design matrix
colnames(designmat) <- c(paste0("x_",as.character(c(1:23))),"y")
# create a random forest model and predict iteratively each value
rfModel <- randomForest(y ~., designmat)
for (i in 1:24){
designvec <- data.frame(c(designmat[nrow(designmat), 2:24], 0))
colnames(designvec) <- colnames(designmat)
designvec$y <- predict(rfModel, designvec)
designmat <- rbind(designmat, designvec)
}
pred2 <- designmat$y
#plot to compare predictions
plot(pred1, type = "l")
lines(y = pred2[216:240], x = c(240:264), col = 2)
Now obviously, there are no general rules as to determine whether a time-series model or a machine learning model are more efficient. Computational time may be higher for machine learning models, but on the other hand, you may include any type of additional features to predict your time-series using them (e.g. not just numerical or logical features). General advice would be to test both, and pick the most efficient model.