Getting started
Install
# from a local checkout / tarball
install.packages("tsforge_1.0.0.tar.gz", repos = NULL, type = "source")Optional capabilities unlock more models (each probed at runtime):
install.packages(c("forecast", "prophet", "rugarch", "vars"))
install.packages(c("ranger", "e1071", "glmnet", "xgboost", "plotly"))First forecast
library(tsforge)
df <- data.frame(
date = seq(as.Date("2021-01-01"), by = "month", length.out = 48),
value = AirPassengers[1:48])
res <- auto_ts(df, "date", "value", horizon = 12, seed = 1)
summary(res) # ranking, fit stats, residual diagnostics
plot(res) # history + forecast + intervals
explain_forecast(res) # why this model, in plain language
db <- ts_dashboard(res, interactive = TRUE)
db # dashboard.qmd/.md/index.html + plotly widgetsModes and metrics
auto_ts(df, "date", "value", horizon = 12,
mode = "fast", # fast | balanced | full
metric = "MAE", # any of 13 metrics
validation = "sliding")Custom models
register_model(
id = "my_model", name = "My model", family = "machine_learning",
fit = function(y, h, m, ...) list(last = tail(y, 1)),
predict = function(fit, h, ...) rep(fit$last, h))See MODEL_REGISTRY_SPEC.md for the full contract.