| Title: | Extending 'mlr3' to Time Series Forecasting |
|---|---|
| Description: | Extends the 'mlr3' package and ecosystem to time series forecasting. Provides forecasting tasks, learners, resampling strategies, performance measures, and 'mlr3pipelines' operators for time-series feature engineering. Machine learning regression learners can be turned into forecasters through recursive and direct multi-step strategies. |
| Authors: | Maximilian Mücke [aut, cre] (ORCID: <https://orcid.org/0009-0000-9432-9795>), Marc Becker [aut] (ORCID: <https://orcid.org/0000-0002-8115-0400>), Bernd Bischl [aut] (ORCID: <https://orcid.org/0000-0001-6002-6980>) |
| Maintainer: | Maximilian Mücke <[email protected]> |
| License: | LGPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-07-22 10:53:14 UTC |
| Source: | https://github.com/cran/mlr3forecast |
Extends the 'mlr3' package and ecosystem to time series forecasting. Provides forecasting tasks, learners, resampling strategies, performance measures, and 'mlr3pipelines' operators for time-series feature engineering. Machine learning regression learners can be turned into forecasters through recursive and direct multi-step strategies.
Maintainer: Maximilian Mücke [email protected] (ORCID)
Authors:
Maximilian Mücke [email protected] (ORCID)
Marc Becker [email protected] (ORCID)
Bernd Bischl [email protected] (ORCID)
Useful links:
Report bugs at https://github.com/mlr-org/mlr3forecast/issues
Convert object to a TaskFcst. This is a S3 generic. mlr3forecast ships with methods for the following objects:
TaskFcst: ensure the identity
data.frame() and mlr3::DataBackend: provides an alternative to the constructor of TaskFcst.
ts: from base R time series objects (univariate and multivariate).
zoo and xts: from zoo/xts time series objects.
timeSeries: from Rmetrics timeSeries objects.
tsf: from tsf format data.
tbl_ts: from tsibble objects.
as_task_fcst(x, ...) as_tasks_fcst(x, ...) ## Default S3 method: as_tasks_fcst(x, ...) ## S3 method for class 'list' as_tasks_fcst(x, ...) ## S3 method for class 'TaskFcst' as_task_fcst(x, clone = FALSE, ...) ## S3 method for class 'DataBackend' as_task_fcst( x, target, order, key = character(), freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'data.frame' as_task_fcst( x, target, order, key = character(), freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'tsf' as_task_fcst(x, id = deparse1(substitute(x)), label = NA_character_, ...) ## S3 method for class 'ts' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'zoo' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'timeSeries' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'tbl_ts' as_task_fcst( x, target, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... )as_task_fcst(x, ...) as_tasks_fcst(x, ...) ## Default S3 method: as_tasks_fcst(x, ...) ## S3 method for class 'list' as_tasks_fcst(x, ...) ## S3 method for class 'TaskFcst' as_task_fcst(x, clone = FALSE, ...) ## S3 method for class 'DataBackend' as_task_fcst( x, target, order, key = character(), freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'data.frame' as_task_fcst( x, target, order, key = character(), freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'tsf' as_task_fcst(x, id = deparse1(substitute(x)), label = NA_character_, ...) ## S3 method for class 'ts' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'zoo' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'timeSeries' as_task_fcst( x, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) ## S3 method for class 'tbl_ts' as_task_fcst( x, target, freq = NULL, id = deparse1(substitute(x)), label = NA_character_, ... )
x |
(any) |
... |
(any) |
clone |
( |
target |
( |
order |
( |
key |
( |
freq |
( |
id |
( |
label |
( |
library(data.table) airpassengers = tsbox::ts_dt(AirPassengers) setnames(airpassengers, c("month", "passengers")) as_task_fcst(airpassengers, target = "passengers", order = "month", freq = "month")library(data.table) airpassengers = tsbox::ts_dt(AirPassengers) setnames(airpassengers, c("month", "passengers")) as_task_fcst(airpassengers, target = "passengers", order = "month", freq = "month")
Generates a forecast plot for PredictionFcst. The point forecast is drawn over the time index. When a
task is supplied, the historical series is overlaid and the forecast region is drawn in a distinct colour,
connected to the last historical observation for visual continuity.
For quantile forecasts, symmetric quantile pairs (e.g. the 10% and 90% quantiles) are drawn as shaded central prediction interval ribbons over the forecast region, shaded darker for narrower intervals and labelled by their level (e.g. 80, 95) in a legend. Quantiles without a symmetric partner are not drawn.
## S3 method for class 'PredictionFcst' autoplot( object, task = NULL, theme = ggplot2::theme_minimal(), facets = FALSE, ... )## S3 method for class 'PredictionFcst' autoplot( object, task = NULL, theme = ggplot2::theme_minimal(), facets = FALSE, ... )
object |
|
task |
(TaskFcst | |
theme |
( |
facets |
( |
... |
( |
ggplot2::ggplot() object.
task = tsk("airpassengers") learner = lrn("fcst.auto_arima")$train(task) p = forecast(learner, task, h = 12) ggplot2::autoplot(p, task = task)task = tsk("airpassengers") learner = lrn("fcst.auto_arima")$train(task) p = forecast(learner, task, h = 12) ggplot2::autoplot(p, task = task)
Generates plots for TaskFcst.
## S3 method for class 'TaskFcst' autoplot(object, theme = ggplot2::theme_minimal(), facets = FALSE, ...)## S3 method for class 'TaskFcst' autoplot(object, theme = ggplot2::theme_minimal(), facets = FALSE, ...)
object |
(TaskFcst). |
theme |
( |
facets |
( |
... |
( |
ggplot2::ggplot() object.
task = tsk("airpassengers") ggplot2::autoplot(task)task = tsk("airpassengers") ggplot2::autoplot(task)
Function to create a DirectForecaster object. This is the recommended way to construct a direct forecaster. It is a
thin wrapper around DirectForecaster$new().
A direct forecaster trains a separate regression model per forecast horizon, so predictions never feed back into one
another (no error accumulation). For the recursive strategy (a single iterated model) see recursive_forecaster().
direct_forecaster( learner, lags, horizons, id = NULL, param_vals = list(), predict_type = NULL )direct_forecaster( learner, lags, horizons, id = NULL, param_vals = list(), predict_type = NULL )
learner |
(mlr3::Learner | mlr3pipelines::Graph | mlr3pipelines::PipeOp) |
lags |
( |
horizons |
( |
id |
( |
param_vals |
(named |
predict_type |
( |
library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # one model per horizon flrn = direct_forecaster(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test)library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # one model per horizon flrn = direct_forecaster(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test)
Trains a separate model for each forecast horizon. For horizon h with base lags 1:p,
model h uses lags h:(h+p-1), so that at prediction time only observed values are needed.
Unlike RecursiveForecaster, predictions do not feed back into subsequent steps (no error accumulation).
Lag features are managed internally via lags. Do not add iterative feature PipeOps (property
"fcst_iterative", e.g. PipeOpFcstLags, PipeOpFcstRolling), which are rejected at construction.
mlr3::Learner -> DirectForecaster
learner(mlr3::Learner)
The base regression learner.
native_model(named list())
The fitted models.
lags(integer())
The base lags.
horizons(integer())
The forecast horizons.
param_set(paradox::ParamSet)
Set of hyperparameters.
marshaled(logical(1))
Whether the learner's model is currently in marshaled form.
predict_type(character(1))
Stores the currently active predict type.
DirectForecaster$new()Creates a new instance of this R6 class.
DirectForecaster$new( learner, lags, horizons, id = NULL, param_vals = list(), predict_type = NULL )
learner(mlr3::Learner | mlr3pipelines::Graph | mlr3pipelines::PipeOp)
A regression learner or a graph/PipeOp (without PipeOpFcstLags).
lags(integer())
The base lag values. Exposed in $param_set as lags, so it can be tuned via
mlr3tuning::AutoTuner.
horizons(integer())
Either a single integer H (expanded to 1:H) or an integer vector of specific horizons.
One model is trained per horizon. At predict time each test row is routed to the model
matching its step-distance from the end of training, so with specific horizons (e.g.
c(2L, 4L, 6L)) the test set may only contain rows at those exact steps ahead.
id(character(1) | NULL)
Identifier, default NULL (auto-generated from the learner id).
param_vals(named list())
Hyperparameter values applied to every horizon model. Per-horizon hyperparameters are not
currently supported.
predict_type(character(1) | NULL)
The predict type, default NULL.
DirectForecaster$print()Printer.
DirectForecaster$print(...)
...(ignored).
DirectForecaster$marshal()Marshal the learner's model.
DirectForecaster$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
DirectForecaster$unmarshal()Unmarshal the learner's model.
DirectForecaster$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
DirectForecaster$clone()The objects of this class are cloneable with this method.
DirectForecaster$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # simple: one model per horizon flrn = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test) # or use the direct_forecaster() helper flrn = direct_forecaster(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test)library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # simple: one model per horizon flrn = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test) # or use the direct_forecaster() helper flrn = direct_forecaster(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)) flrn$train(task, split$train) flrn$predict(task, split$test)
Downloads a tsf file from Zenodo using the provided record ID and dataset name.
download_zenodo_record(record_id = 4656222, dataset_name = "m3_yearly_dataset")download_zenodo_record(record_id = 4656222, dataset_name = "m3_yearly_dataset")
record_id |
( |
dataset_name |
( |
(data.table::data.table()) with class "tsf". If the file contains a frequency or horizon, the
"frequency" and "horizon" attributes are set, respectively.
Godahewa R, Bergmeir C, Webb GI, Hyndman RJ, Montero-Manso P (2021). “Monash time series forecasting archive.” arXiv preprint arXiv:2105.06643.
## Not run: library(data.table) dt = download_zenodo_record(record_id = 4656222, dataset_name = "m3_yearly_dataset") # optional renaming setnames(dt, c("id", "date", "value")) # transform into single task task = as_task_fcst(dt) # or split up for forecast learners that don't allow key columns tasks = as_tasks_fcst(split(dt, by = "id", keep.by = FALSE)) # benchmark learners = lrns(c("fcst.auto_arima", "fcst.ets", "fcst.random_walk")) resampling = rsmp("fcst.holdout", ratio = 0.8) design = benchmark_grid(tasks, learners, resampling) bmr = benchmark(design) bmr$aggregate(msr("regr.rmse"))[, .(rmse = mean(regr.rmse)), by = learner_id] ## End(Not run)## Not run: library(data.table) dt = download_zenodo_record(record_id = 4656222, dataset_name = "m3_yearly_dataset") # optional renaming setnames(dt, c("id", "date", "value")) # transform into single task task = as_task_fcst(dt) # or split up for forecast learners that don't allow key columns tasks = as_tasks_fcst(split(dt, by = "id", keep.by = FALSE)) # benchmark learners = lrns(c("fcst.auto_arima", "fcst.ets", "fcst.random_walk")) resampling = rsmp("fcst.holdout", ratio = 0.8) design = benchmark_grid(tasks, learners, resampling) bmr = benchmark(design) bmr$aggregate(msr("regr.rmse"))[, .(rmse = mean(regr.rmse)), by = learner_id] ## End(Not run)
Generates h future rows from the task's skeleton (using generate_newdata()), optionally overlays user-supplied
newdata onto those rows, and predicts with the trained learner via mlr3::Learner$predict_newdata(). Works with
RecursiveForecaster, DirectForecaster, and classic LearnerFcst* forecasters.
## S3 method for class 'Learner' forecast(object, task, h = 12L, newdata = NULL, ...)## S3 method for class 'Learner' forecast(object, task, h = 12L, newdata = NULL, ...)
object |
(mlr3::Learner) |
task |
(TaskFcst) |
h |
( |
newdata |
( |
... |
(any) |
Generate new data for a forecast task
generate_newdata(task, n = 1L)generate_newdata(task, n = 1L)
task |
TaskFcst |
n |
( |
Future dates are extrapolated by stepping the order column. For calendar freq (month/quarter/year), the
origin's day-of-month is carried forward and clamped to each target month's last valid day. Other freqs use
base::seq(). Month-end is not inferred, so use a first-of-month or period-style index for genuine month-end series.
A data.table::data.table() with n new data points.
This Learner specializes mlr3::LearnerRegr for forecast problems:
task_type is set to "fcst".
Creates mlr3::Predictions of class PredictionFcst.
Possible values for predict_types are:
"response": Predicts a numeric response for each observation in the test set.
"se": Predicts the standard error for each value of response for each observation in the test set.
"distr": Probability distribution as VectorDistribution object (requires package distr6, available via
repository https://raphaels1.r-universe.dev).
"quantiles": Predicts quantile estimates for each observation in the test set.
Set $quantiles to specify the quantiles to predict and $quantile_response to specify the response quantile.
See the mlr3book
on quantile regression for more details.
Predefined learners can be found in the dictionary mlr3::mlr_learners.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst
native_model(any)
The fitted model.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcst$new()Creates a new instance of this R6 class.
LearnerFcst$new( id, param_set = ps(), predict_types = "response", feature_types = character(), properties = character(), packages = character(), label = NA_character_, man = NA_character_ )
id(character(1))
Identifier for the new instance.
param_set(paradox::ParamSet)
Set of hyperparameters.
predict_types(character())
Supported predict types. Must be a subset of mlr_reflections$learner_predict_types.
feature_types(character())
Feature types the learner operates on. Must be a subset of mlr_reflections$task_feature_types.
properties(character())
Set of properties of the mlr3::Learner.
Must be a subset of mlr_reflections$learner_properties.
The following properties are currently standardized and understood by learners in mlr3:
"missings": The learner can handle missing values in the data.
"weights": The learner supports observation weights.
"offset": The learner can incorporate offset values to adjust predictions.
"importance": The learner supports extraction of importance scores, i.e. comes with an $importance() extractor function (see section on optional extractors in mlr3::Learner).
"selected_features": The learner supports extraction of the set of selected features, i.e. comes with a $selected_features() extractor function (see section on optional extractors in mlr3::Learner).
"oob_error": The learner supports extraction of estimated out of bag error, i.e. comes with a oob_error() extractor function (see section on optional extractors in mlr3::Learner).
"validation": The learner can use a validation task during training.
"internal_tuning": The learner is able to internally optimize hyperparameters (those are also tagged with "internal_tuning").
"marshal": To save learners with this property, you need to call $marshal() first.
If a learner is in a marshaled state, you call first need to call $unmarshal() to use its model, e.g. for prediction.
"hotstart_forward": The learner supports to hotstart a model forward.
"hotstart_backward": The learner supports hotstarting a model backward.
"featureless": The learner does not use features.
packages(character())
Set of required packages.
A warning is signaled by the constructor if at least one of the packages is not installed,
but loaded (not attached) later on-demand via requireNamespace().
label(character(1))
Label for the new instance.
man(character(1))
String in the format [pkg]::[topic] pointing to a manual page for this object.
The referenced help package can be opened via method $help().
LearnerFcst$clone()The objects of this class are cloneable with this method.
LearnerFcst$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# get all forecast learners from mlr_learners: lrns = mlr_learners$mget(mlr_learners$keys("^fcst")) names(lrns) # get a specific learner from mlr_learners: mlr_learners$get("fcst.ets") lrn("fcst.auto_arima")# get all forecast learners from mlr_learners: lrns = mlr_learners$mget(mlr_learners$keys("^fcst")) names(lrns) # get a specific learner from mlr_learners: mlr_learners$get("fcst.ets") lrn("fcst.auto_arima")
Create a new Graph that wraps graph between
po("fcst.splitkey") and
po("fcst.unitekey"), fitting one local model per series of a
keyed TaskFcst instead of one global model pooled across series.
All input arguments are cloned and have no references in common with the returned Graph.
pipeline_fcst_local(graph, key = "key")pipeline_fcst_local(graph, key = "key")
graph |
(Graph) |
key |
( |
library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") flrn = as_learner(ppl("fcst.local", lrn("fcst.ets")))$train(task) forecast(flrn, task, 12L)library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") flrn = as_learner(ppl("fcst.local", lrn("fcst.ets")))$train(task) forecast(flrn, task, 12L)
Augmented Dynamic Adaptive Model (ADAM) Forecast Learner model.
Calls smooth::adam() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.adam")
lrn("fcst.adam")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels | Range |
| model | untyped | "ZXZ" | - | |
| lags | untyped | - | - | |
| orders | untyped | list(ar = 0, i = 0, ma = 0, select = FALSE) | - | |
| constant | logical | FALSE | TRUE, FALSE | - |
| regressors | character | use | use, select, adapt | - |
| occurrence | character | none | none, auto, fixed, general, odds-ratio, inverse-odds-ratio, direct | - |
| distribution | character | default | default, dnorm, dlaplace, ds, dgnorm, dlnorm, dinvgauss, dgamma | - |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, LASSO, RIDGE, MSEh, TMSE, GTMSE, MSCE, ... | - |
| outliers | character | ignore | ignore, use, select | - |
| holdout | logical | FALSE | TRUE, FALSE | - |
| persistence | untyped | NULL | - | |
| phi | numeric | NULL | |
|
| initial | character | backcasting | backcasting, optimal, two-stage, complete | - |
| arma | untyped | NULL | - | |
| ic | character | AICc | AICc, AIC, BIC, BICc | - |
| bounds | character | usual | usual, admissible, none | - |
| silent | logical | TRUE | TRUE, FALSE | - |
| ets | character | conventional | conventional, adam | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAdam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAdam$new()Creates a new instance of this R6 class.
LearnerFcstAdam$new()
LearnerFcstAdam$clone()The objects of this class are cloneable with this method.
LearnerFcstAdam$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.adam") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.adam") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
ARFIMA model.
Calls forecast::arfima() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.arfima")
lrn("fcst.arfima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| drange | untyped | c(0, 0.5) | - | |
| estim | character | mle | mle, ls | - |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 | |
|
| max.p | integer | 5 | |
|
| max.q | integer | 5 | |
|
| max.order | integer | 5 | |
|
| start.p | integer | 2 | |
|
| start.q | integer | 2 | |
|
| ic | character | aicc | aicc, aic, bic | - |
| stepwise | logical | TRUE | TRUE, FALSE | - |
| nmodels | integer | 94 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| approximation | logical | - | TRUE, FALSE | - |
| method | character | NULL | CSS-ML, ML, CSS | - |
| truncate | integer | NULL | |
|
| parallel | logical | FALSE | TRUE, FALSE | - |
| num.cores | integer | 2 | |
|
| transform.pars | logical | TRUE | TRUE, FALSE | - |
| fixed | untyped | NULL | - | |
| init | untyped | NULL | - | |
| SSinit | character | Gardner1980 | Gardner1980, Rossignol2011 | - |
| n.cond | integer | - | |
|
| optim.method | character | BFGS | Nelder-Mead, BFGS, CG, L-BFGS-B, SANN, Brent | - |
| optim.control | untyped | list() | - | |
| kappa | numeric | 1e+06 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstArfima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstArfima$new()Creates a new instance of this R6 class.
LearnerFcstArfima$new()
LearnerFcstArfima$clone()The objects of this class are cloneable with this method.
LearnerFcstArfima$clone(deep = FALSE)
deepWhether to make a deep clone.
Haslett J, Raftery AE (1989). “Space-time Modelling with Long-memory Dependence: Assessing Ireland's Wind Power Resource.” Journal of the Royal Statistical Society: Series C (Applied Statistics), 38(1), 1–21.
Hyndman RJ, Khandakar Y (2008). “Automatic Time Series Forecasting: The forecast Package for R.” Journal of Statistical Software, 27(3), 1–22. doi:10.18637/jss.v027.i03.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.arfima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.arfima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Autoregressive Integrated Moving Average Forecast (ARIMA) model.
Calls forecast::Arima() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.arima")
lrn("fcst.arima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| order | untyped | c(0L, 0L, 0L) | - | |
| seasonal | untyped | c(0L, 0L, 0L) | - | |
| include.mean | logical | TRUE | TRUE, FALSE | - |
| include.drift | logical | FALSE | TRUE, FALSE | - |
| include.constant | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| method | character | CSS-ML | CSS-ML, ML, CSS | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 | |
|
| transform.pars | logical | TRUE | TRUE, FALSE | - |
| fixed | untyped | NULL | - | |
| init | untyped | NULL | - | |
| SSinit | character | Gardner1980 | Gardner1980, Rossignol2011 | - |
| n.cond | integer | - | |
|
| optim.method | character | BFGS | Nelder-Mead, BFGS, CG, L-BFGS-B, SANN, Brent | - |
| optim.control | untyped | list() | - | |
| kappa | numeric | 1e+06 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstArima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstArima$new()Creates a new instance of this R6 class.
LearnerFcstArima$new()
LearnerFcstArima$clone()The objects of this class are cloneable with this method.
LearnerFcstArima$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Athanasopoulos G (2018). Forecasting: principles and practice, 2nd edition. OTexts, Melbourne, Australia. https://OTexts.com/fpp2/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.arima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.arima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Auto Augmented Dynamic Adaptive Model (ADAM) model.
Calls smooth::auto.adam() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_adam")
lrn("fcst.auto_adam")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels | Range |
| model | untyped | "ZXZ" | - | |
| lags | untyped | - | - | |
| orders | untyped | list(ar = c(3, 3), i = c(2, 1), ma = c(3, 3), select = TRUE) | - | |
| regressors | character | use | use, select, adapt | - |
| occurrence | character | none | none, auto, fixed, general, odds-ratio, inverse-odds-ratio, direct | - |
| distribution | character | dnorm | dnorm, dlaplace, ds, dgnorm, dlnorm, dinvgauss, dgamma | - |
| outliers | character | ignore | ignore, use, select | - |
| holdout | logical | FALSE | TRUE, FALSE | - |
| persistence | untyped | NULL | - | |
| phi | numeric | NULL | |
|
| initial | character | backcasting | backcasting, optimal, two-stage, complete | - |
| arma | untyped | NULL | - | |
| ic | character | AICc | AICc, AIC, BIC, BICc | - |
| bounds | character | usual | usual, admissible, none | - |
| silent | logical | TRUE | TRUE, FALSE | - |
| parallel | logical | FALSE | TRUE, FALSE | - |
| ets | character | conventional | conventional, adam | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAutoAdam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoAdam$new()Creates a new instance of this R6 class.
LearnerFcstAutoAdam$new()
LearnerFcstAutoAdam$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoAdam$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_adam") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_adam") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Auto ARIMA model.
Calls forecast::auto.arima() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_arima")
lrn("fcst.auto_arima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| d | integer | NA | |
|
| D | integer | NA | |
|
| max.p | integer | 5 | |
|
| max.q | integer | 5 | |
|
| max.P | integer | 2 | |
|
| max.Q | integer | 2 | |
|
| max.order | integer | 5 | |
|
| max.d | integer | 2 | |
|
| max.D | integer | 1 | |
|
| start.p | integer | 2 | |
|
| start.q | integer | 2 | |
|
| start.P | integer | 1 | |
|
| start.Q | integer | 1 | |
|
| stationary | logical | FALSE | TRUE, FALSE | - |
| seasonal | logical | TRUE | TRUE, FALSE | - |
| ic | character | aicc | aicc, aic, bic | - |
| stepwise | logical | TRUE | TRUE, FALSE | - |
| nmodels | integer | 94 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| approximation | logical | - | TRUE, FALSE | - |
| method | character | NULL | CSS-ML, ML, CSS | - |
| truncate | integer | NULL | |
|
| test | character | kpss | kpss, adf, pp | - |
| test.args | untyped | list() | - | |
| seasonal.test | character | seas | seas, ocsb, hegy, ch | - |
| seasonal.test.args | untyped | list() | - | |
| allowdrift | logical | TRUE | TRUE, FALSE | - |
| allowmean | logical | TRUE | TRUE, FALSE | - |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| parallel | logical | FALSE | TRUE, FALSE | - |
| num.cores | integer | 2 | |
|
| lambda | untyped | NULL | - | |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 | |
|
| transform.pars | logical | TRUE | TRUE, FALSE | - |
| fixed | untyped | NULL | - | |
| init | untyped | NULL | - | |
| SSinit | character | Gardner1980 | Gardner1980, Rossignol2011 | - |
| n.cond | integer | - | |
|
| optim.method | character | BFGS | Nelder-Mead, BFGS, CG, L-BFGS-B, SANN, Brent | - |
| optim.control | untyped | list() | - | |
| kappa | numeric | 1e+06 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstAutoArima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoArima$new()Creates a new instance of this R6 class.
LearnerFcstAutoArima$new()
LearnerFcstAutoArima$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoArima$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Khandakar Y (2008). “Automatic Time Series Forecasting: The forecast Package for R.” Journal of Statistical Software, 27(3), 1–22. doi:10.18637/jss.v027.i03.
Wang X, Smith K, Hyndman R (2006). “Characteristic-based clustering for time series data.” Data Mining and Knowledge Discovery, 13, 335–364.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_arima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_arima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Auto Complex Exponential Smoothing (CES) model.
Calls smooth::auto.ces() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_ces")
lrn("fcst.auto_ces")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| seasonality | character | none | none, simple, partial, full |
| lags | untyped | - | |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| ic | character | AICc | AICc, AIC, BIC, BICc |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | admissible | admissible, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAutoCes
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoCes$new()Creates a new instance of this R6 class.
LearnerFcstAutoCes$new()
LearnerFcstAutoCes$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoCes$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_ces") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_ces") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Automatic selection over Generalised Univariate Model (GUM) specifications via an information criterion.
Calls smooth::auto.gum() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_gum")
lrn("fcst.auto_gum")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels | Range |
| orders | integer | 3 | |
|
| lags | integer | - | |
|
| type | character | additive | additive, multiplicative, select | - |
| initial | character | backcasting | backcasting, optimal, two-stage, complete | - |
| ic | character | AICc | AICc, AIC, BIC, BICc | - |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL | - |
| holdout | logical | FALSE | TRUE, FALSE | - |
| bounds | character | usual | usual, admissible, none | - |
| silent | logical | TRUE | TRUE, FALSE | - |
| regressors | character | use | use, select, adapt, integrate | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAutoGum
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoGum$new()Creates a new instance of this R6 class.
LearnerFcstAutoGum$new()
LearnerFcstAutoGum$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoGum$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_gum") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_gum") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Automatic order selection for Multiple-Seasonal ARIMA. Picks orders minimising the chosen
information criterion.
Calls smooth::auto.msarima() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_msarima")
lrn("fcst.auto_msarima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| orders | untyped | list(ar = c(3, 3), i = c(2, 1), ma = c(3, 3)) | |
| lags | untyped | - | |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| ic | character | AICc | AICc, AIC, BIC, BICc |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | usual | usual, admissible, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAutoMsarima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoMsarima$new()Creates a new instance of this R6 class.
LearnerFcstAutoMsarima$new()
LearnerFcstAutoMsarima$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoMsarima$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_msarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_msarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Automatic order selection for State-Space ARIMA. Picks orders minimising the chosen
information criterion.
Calls smooth::auto.ssarima() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.auto_ssarima")
lrn("fcst.auto_ssarima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| orders | untyped | list(ar = c(3, 3), i = c(2, 1), ma = c(3, 3)) | |
| lags | untyped | - | |
| fast | logical | TRUE | TRUE, FALSE |
| constant | logical | NULL | TRUE, FALSE |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| ic | character | AICc | AICc, AIC, BIC, BICc |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | admissible | admissible, usual, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstAutoSsarima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstAutoSsarima$new()Creates a new instance of this R6 class.
LearnerFcstAutoSsarima$new()
LearnerFcstAutoSsarima$clone()The objects of this class are cloneable with this method.
LearnerFcstAutoSsarima$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.auto_ssarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.auto_ssarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bootstrap-aggregated forecasts. The series is resampled via the Box-Cox/Loess moving block bootstrap of Bergmeir,
Hyndman, and Benítez and fn is fit on each replicate. The forecast averages across the ensemble.
Calls forecast::baggedModel() from package forecast.
fn is the model-fitting function applied to each bootstrap replicate (defaults to forecast::ets()). Any function
returning an object compatible with forecast::forecast() may be passed, e.g. forecast::auto.arima() or
forecast::Arima() with fixed orders via a wrapper. The number of bootstrap replicates is controlled by num, and
block_size configures the moving block length in forecast::bld.mbb.bootstrap(). Prediction intervals from
forecast::forecast.baggedModel() are the empirical bootstrap range (not configurable by level), so only
"response" is offered as a predict_type.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.bagged")
lrn("fcst.bagged")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Range |
| fn | untyped | - | - |
| num | integer | 100 | |
| block_size | integer | NULL |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstBaggedModel
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstBaggedModel$new()Creates a new instance of this R6 class.
LearnerFcstBaggedModel$new()
LearnerFcstBaggedModel$clone()The objects of this class are cloneable with this method.
LearnerFcstBaggedModel$clone(deep = FALSE)
deepWhether to make a deep clone.
Bergmeir C, Hyndman RJ, Benítez JM (2016). “Bagging exponential smoothing methods using STL decomposition and Box-Cox transformation.” International Journal of Forecasting, 32(2), 303–312. doi:10.1016/j.ijforecast.2015.07.002.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.bagged") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.bagged") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components
(BATS) model.
Calls forecast::bats() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.bats")
lrn("fcst.bats")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| use.box.cox | logical | NULL | TRUE, FALSE | - |
| use.trend | logical | NULL | TRUE, FALSE | - |
| use.damped.trend | logical | NULL | TRUE, FALSE | - |
| seasonal.periods | untyped | NULL | - | |
| use.arma.errors | logical | TRUE | TRUE, FALSE | - |
| use.parallel | logical | - | TRUE, FALSE | - |
| num.cores | integer | 2 | |
|
| bc.lower | numeric | 0 | |
|
| bc.upper | numeric | 1 | |
|
| biasadj | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstBats
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstBats$new()Creates a new instance of this R6 class.
LearnerFcstBats$new()
LearnerFcstBats$clone()The objects of this class are cloneable with this method.
LearnerFcstBats$clone(deep = FALSE)
deepWhether to make a deep clone.
De Livera AM, Hyndman RJ, Snyder RD (2011). “Forecasting time series with complex seasonal patterns using exponential smoothing.” Journal of the American Statistical Association, 106(496), 1513–1527.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.bats") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.bats") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Complex Exponential Smoothing (CES) model.
Calls smooth::ces() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.ces")
lrn("fcst.ces")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| seasonality | character | none | none, simple, partial, full |
| lags | untyped | - | |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| a | untyped | NULL | |
| b | untyped | NULL | |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | admissible | admissible, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstCes
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstCes$new()Creates a new instance of this R6 class.
LearnerFcstCes$new()
LearnerFcstCes$clone()The objects of this class are cloneable with this method.
LearnerFcstCes$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.ces") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.ces") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Croston model.
Calls forecast::croston_model() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.croston")
lrn("fcst.croston")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| alpha | numeric | 0.1 | |
|
| type | character | croston | croston, sba, sbj | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstCroston
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstCroston$new()Creates a new instance of this R6 class.
LearnerFcstCroston$new()
LearnerFcstCroston$clone()The objects of this class are cloneable with this method.
LearnerFcstCroston$clone(deep = FALSE)
deepWhether to make a deep clone.
Croston JD (1972). “Forecasting and stock control for intermittent demands.” Journal of the Operational Research Society, 23(3), 289–303.
Shale EA, Boylan JE, Johnston F (2006). “Forecasting for intermittent demand: the estimation of an unbiased average.” Journal of the Operational Research Society, 57(5), 588–592.
Shenstone L, Hyndman RJ (2005). “Stochastic models underlying Croston's method for intermittent demand forecasting.” Journal of Forecasting, 24(6), 389–402.
Syntetos AA, Boylan JE (2001). “On the bias of intermittent demand estimates.” International Journal of Production Economics, 71(1-3), 457–466.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.croston") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.croston") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Automatic time series forecasting with an extreme learning machine neural network, including automatic input lag
selection, deterministic seasonality handling, and ensemble combination across multiple training repetitions.
Calls nnfor::elm() from package nnfor.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.elm")
lrn("fcst.elm")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, nnfor, forecast
| Id | Type | Default | Levels | Range |
| m | integer | - | |
|
| hd | untyped | NULL | - | |
| type | character | lasso | lasso, ridge, step, lm | - |
| reps | integer | 20 | |
|
| comb | character | median | median, mean, mode | - |
| lags | untyped | NULL | - | |
| keep | untyped | NULL | - | |
| difforder | untyped | NULL | - | |
| sel.lag | logical | TRUE | TRUE, FALSE | - |
| direct | logical | FALSE | TRUE, FALSE | - |
| allow.det.season | logical | TRUE | TRUE, FALSE | - |
| det.type | character | auto | auto, bin, trg | - |
| barebone | logical | FALSE | TRUE, FALSE | - |
| retrain | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstElm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstElm$new()Creates a new instance of this R6 class.
LearnerFcstElm$new()
LearnerFcstElm$clone()The objects of this class are cloneable with this method.
LearnerFcstElm$clone(deep = FALSE)
deepWhether to make a deep clone.
Kourentzes N, Barrow DK, Crone SF (2014). “Neural network ensemble operators for time series forecasting.” Expert Systems with Applications, 41(9), 4235–4244. doi:10.1016/j.eswa.2013.12.011.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.elm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.elm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Exponential smoothing (ETS) model in state-space form. Supports multiple seasonal lags natively
(e.g. lags = c(1, 24, 168) for hourly data with daily and weekly cycles).
Calls smooth::es() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.es")
lrn("fcst.es")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels | Range |
| model | untyped | "ZXZ" | - | |
| lags | untyped | - | - | |
| persistence | untyped | NULL | - | |
| phi | numeric | NULL | |
|
| initial | character | backcasting | backcasting, optimal, two-stage, complete | - |
| initialSeason | untyped | NULL | - | |
| ic | character | AICc | AICc, AIC, BIC, BICc | - |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL | - |
| holdout | logical | FALSE | TRUE, FALSE | - |
| bounds | character | usual | usual, admissible, none | - |
| silent | logical | TRUE | TRUE, FALSE | - |
| regressors | character | use | use, select | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstEs
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstEs$new()Creates a new instance of this R6 class.
LearnerFcstEs$new()
LearnerFcstEs$clone()The objects of this class are cloneable with this method.
LearnerFcstEs$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.es") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.es") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Exponential Smoothing State Space (ETS) model.
Calls forecast::ets() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.ets")
lrn("fcst.ets")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| model | untyped | "ZZZ" | - | |
| damped | logical | NULL | TRUE, FALSE | - |
| alpha | numeric | NULL | |
|
| beta | numeric | NULL | |
|
| gamma | numeric | NULL | |
|
| phi | numeric | NULL | |
|
| additive.only | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| lower | untyped | c(rep.int(1e-04, 3), 0.8) | - | |
| upper | untyped | c(rep.int(0.9999, 3), 0.98) | - | |
| opt.crit | character | lik | lik, amse, mse, sigma, mae | - |
| nmse | integer | 3 | |
|
| bounds | character | both | both, usual, admissible | - |
| ic | character | aicc | aicc, aic, bic | - |
| restrict | logical | TRUE | TRUE, FALSE | - |
| allow.multiplicative.trend | logical | FALSE | TRUE, FALSE | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstEts
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstEts$new()Creates a new instance of this R6 class.
LearnerFcstEts$new()
LearnerFcstEts$clone()The objects of this class are cloneable with this method.
LearnerFcstEts$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Koehler AB, Snyder RD, Grose S (2002). “A state space framework for automatic forecasting using exponential smoothing methods.” International Journal of Forecasting, 18(3), 439–454.
Hyndman RJ, Akram M, Archibald B (2008). “The admissible parameter space for exponential smoothing models.” Annals of the Institute of Statistical Mathematics, 60(2), 407–426.
Hyndman RJ, Koehler AB, Ord JK, Snyder RD (2008). Forecasting with exponential smoothing: the state space approach. Springer-Verlag. https://robjhyndman.com/expsmooth/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.ets") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.ets") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalised Univariate Model (GUM): a single-source-of-error state-space model with a user-defined transition matrix,
persistence vector and measurement vector. Generalises exponential smoothing beyond the ETS structural template.
Calls smooth::gum() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.gum")
lrn("fcst.gum")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| orders | untyped | c(1, 1) | |
| lags | untyped | - | |
| type | character | additive | additive, multiplicative |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| persistence | untyped | NULL | |
| transition | untyped | NULL | |
| measurement | untyped | NULL | |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | usual | usual, admissible, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt, integrate |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstGum
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstGum$new()Creates a new instance of this R6 class.
LearnerFcstGum$new()
LearnerFcstGum$clone()The objects of this class are cloneable with this method.
LearnerFcstGum$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.gum") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.gum") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Holt-Winters exponential smoothing with optional trend and additive or multiplicative seasonal component.
Smoothing parameters are estimated by minimizing the squared one-step prediction error.
Calls stats::HoltWinters() from package stats and forecasts via forecast::forecast().
Setting beta = FALSE fits a simple exponential smoothing model (no trend).
Setting gamma = FALSE fits a non-seasonal model.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.holt_winters")
lrn("fcst.holt_winters")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| alpha | numeric | NULL | |
|
| beta | numeric | NULL | |
|
| gamma | numeric | NULL | |
|
| seasonal | character | additive | additive, multiplicative | - |
| start.periods | integer | 2 | |
|
| l.start | numeric | NULL | |
|
| b.start | numeric | NULL | |
|
| s.start | untyped | NULL | - | |
| optim.start | untyped | c(alpha = 0.3, beta = 0.1, gamma = 0.1) | - | |
| optim.control | untyped | list() | - | |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstHoltWinters
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstHoltWinters$new()Creates a new instance of this R6 class.
LearnerFcstHoltWinters$new()
LearnerFcstHoltWinters$clone()The objects of this class are cloneable with this method.
LearnerFcstHoltWinters$clone(deep = FALSE)
deepWhether to make a deep clone.
Holt CC (2004). “Forecasting seasonals and trends by exponentially weighted moving averages.” International Journal of Forecasting, 20(1), 5–10. doi:10.1016/j.ijforecast.2003.09.015.
Winters PR (1960). “Forecasting Sales by Exponentially Weighted Moving Averages.” Management Science, 6(3), 324–342. doi:10.1287/mnsc.6.3.324.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.holt_winters") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.holt_winters") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Mean model.
Calls forecast::mean_model() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.mean")
lrn("fcst.mean")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels |
| lambda | untyped | NULL | |
| biasadj | logical | FALSE | TRUE, FALSE |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstMean
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstMean$new()Creates a new instance of this R6 class.
LearnerFcstMean$new()
LearnerFcstMean$clone()The objects of this class are cloneable with this method.
LearnerFcstMean$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Athanasopoulos G (2018). Forecasting: principles and practice, 2nd edition. OTexts, Melbourne, Australia. https://OTexts.com/fpp2/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.mean") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.mean") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Automatic time series forecasting with a multilayer perceptron neural network, including automatic input lag
selection, deterministic seasonality handling, and ensemble combination across multiple training repetitions.
Calls nnfor::mlp() from package nnfor.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.mlp")
lrn("fcst.mlp")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, nnfor, forecast
| Id | Type | Default | Levels | Range |
| m | integer | - | |
|
| hd | untyped | NULL | - | |
| reps | integer | 20 | |
|
| comb | character | median | median, mean, mode | - |
| lags | untyped | NULL | - | |
| keep | untyped | NULL | - | |
| difforder | untyped | NULL | - | |
| sel.lag | logical | TRUE | TRUE, FALSE | - |
| allow.det.season | logical | TRUE | TRUE, FALSE | - |
| det.type | character | auto | auto, bin, trg | - |
| hd.auto.type | character | set | set, valid, cv, elm | - |
| hd.max | integer | NULL | |
|
| retrain | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstMlp
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstMlp$new()Creates a new instance of this R6 class.
LearnerFcstMlp$new()
LearnerFcstMlp$clone()The objects of this class are cloneable with this method.
LearnerFcstMlp$clone(deep = FALSE)
deepWhether to make a deep clone.
Kourentzes N, Barrow DK, Crone SF (2014). “Neural network ensemble operators for time series forecasting.” Expert Systems with Applications, 41(9), 4235–4244. doi:10.1016/j.eswa.2013.12.011.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.mlp") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.mlp") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Multiple-Seasonal ARIMA model in state-space form. Supports multiple seasonal lags natively
(e.g. lags = c(1, 24, 168) for hourly data with daily and weekly cycles).
Calls smooth::msarima() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.msarima")
lrn("fcst.msarima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| orders | untyped | list(ar = 0, i = 1, ma = 1) | |
| lags | untyped | 1 | |
| constant | logical | FALSE | TRUE, FALSE |
| arma | untyped | NULL | |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| ic | character | AICc | AICc, AIC, BIC, BICc |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | usual | usual, admissible, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstMsarima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstMsarima$new()Creates a new instance of this R6 class.
LearnerFcstMsarima$new()
LearnerFcstMsarima$clone()The objects of this class are cloneable with this method.
LearnerFcstMsarima$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.msarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.msarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Single Layer Neural Network.
Calls forecast::nnetar() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.nnetar")
lrn("fcst.nnetar")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| p | integer | - | |
|
| P | integer | 1 | |
|
| size | integer | NULL | |
|
| repeats | integer | 20 | |
|
| lambda | untyped | NULL | - | |
| scale.inputs | logical | TRUE | TRUE, FALSE | - |
| parallel | logical | FALSE | TRUE, FALSE | - |
| num.cores | integer | 2 | |
|
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 1000 | |
|
| innov | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstNnetar
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstNnetar$new()Creates a new instance of this R6 class.
LearnerFcstNnetar$new()
LearnerFcstNnetar$clone()The objects of this class are cloneable with this method.
LearnerFcstNnetar$clone(deep = FALSE)
deepWhether to make a deep clone.
Ripley BD (1996). Pattern Recognition and Neural Networks. Cambridge University Press. doi:10.1017/cbo9780511812651.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.nnetar") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.nnetar") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Prophet model.
Calls prophet::prophet() from package prophet.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.prophet")
lrn("fcst.prophet")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, prophet
| Id | Type | Default | Levels | Range |
| growth | character | linear | linear, logistic, flat | - |
| changepoints | untyped | NULL | - | |
| n.changepoints | integer | 25 | |
|
| changepoint.range | numeric | 0.8 | |
|
| yearly.seasonality | untyped | "auto" | - | |
| weekly.seasonality | untyped | "auto" | - | |
| daily.seasonality | untyped | "auto" | - | |
| holidays | untyped | NULL | - | |
| seasonality.mode | character | additive | additive, multiplicative | - |
| seasonality.prior.scale | numeric | 10 | |
|
| holidays.prior.scale | numeric | 10 | |
|
| changepoint.prior.scale | numeric | 0.05 | |
|
| mcmc.samples | integer | 0 | |
|
| interval.width | numeric | 0.8 | |
|
| uncertainty.samples | integer | 1000 | |
|
| backend | character | NULL | rstan, cmdstanr | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstProphet
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstProphet$new()Creates a new instance of this R6 class.
LearnerFcstProphet$new()
LearnerFcstProphet$clone()The objects of this class are cloneable with this method.
LearnerFcstProphet$clone(deep = FALSE)
deepWhether to make a deep clone.
Taylor SJ, Letham B (2018). “Forecasting at Scale.” The American Statistician, 72(1), 37–45. doi:10.1080/00031305.2017.1380080.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.prophet") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.prophet") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random walk model.
Calls forecast::rw_model() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.random_walk")
lrn("fcst.random_walk")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| lag | integer | 1 | |
|
| drift | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstRandomWalk
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstRandomWalk$new()Creates a new instance of this R6 class.
LearnerFcstRandomWalk$new()
LearnerFcstRandomWalk$clone()The objects of this class are cloneable with this method.
LearnerFcstRandomWalk$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.random_walk") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.random_walk") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian exponential smoothing with a nonlinear global trend (LGT/SGT), Student-t errors, and optional
heteroscedasticity, fitted via MCMC. The seasonal period is taken from the frequency of the series.
Calls Rlgt::rlgt() from package Rlgt.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.rlgt")
lrn("fcst.rlgt")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, Rlgt
| Id | Type | Default | Levels | Range |
| seasonality | integer | 1 | |
|
| seasonality2 | integer | 1 | |
|
| seasonality.type | character | multiplicative | multiplicative, generalized | - |
| error.size.method | character | std | std, innov | - |
| level.method | character | HW | HW, seasAvg, HW_sAvg | - |
| method | character | Gibbs | Gibbs, Stan | - |
| homoscedastic | logical | FALSE | TRUE, FALSE | - |
| control | untyped | NULL | - | |
| verbose | logical | FALSE | TRUE, FALSE | - |
| NUM_OF_TRIALS | integer | 2000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstRlgt
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstRlgt$new()Creates a new instance of this R6 class.
LearnerFcstRlgt$new()
LearnerFcstRlgt$clone()The objects of this class are cloneable with this method.
LearnerFcstRlgt$clone(deep = FALSE)
deepWhether to make a deep clone.
Smyl S, Bergmeir C, Wibowo E, Ng TW, Long X, Dokumentov A, Schmidt D (2025). Rlgt: Bayesian Exponential Smoothing Models with Trend Modifications. R package version 0.2-3, https://github.com/cbergmeir/Rlgt.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.rlgt") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.rlgt") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Simple moving average. The forecast is the mean of the last order observations.
If order is NULL (the default), the optimal window is selected automatically
according to the chosen information criterion ic.
Calls smooth::sma() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.sma")
lrn("fcst.sma")
Task type: “fcst”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels | Range |
| order | integer | NULL | |
|
| ic | character | AICc | AICc, AIC, BIC, BICc | - |
| holdout | logical | FALSE | TRUE, FALSE | - |
| silent | logical | TRUE | TRUE, FALSE | - |
| fast | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSma
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstSma$new()Creates a new instance of this R6 class.
LearnerFcstSma$new()
LearnerFcstSma$clone()The objects of this class are cloneable with this method.
LearnerFcstSma$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.sma") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.sma") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Cubic spline stochastic model.
Calls forecast::spline_model() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.spline")
lrn("fcst.spline")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| method | character | gcv | gcv, mle | - |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstSpline
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstSpline$new()Creates a new instance of this R6 class.
LearnerFcstSpline$new()
LearnerFcstSpline$clone()The objects of this class are cloneable with this method.
LearnerFcstSpline$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, King ML, Pitrun I, Billah B (2005). “Local linear forecasts using cubic smoothing splines.” Australian & New Zealand Journal of Statistics, 47(1), 87–99.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.spline") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.spline") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
State-Space ARIMA model. Supports multiple seasonal lags natively
(e.g. lags = c(1, 24, 168) for hourly data with daily and weekly cycles).
Calls smooth::ssarima() from package smooth.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.ssarima")
lrn("fcst.ssarima")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, smooth
| Id | Type | Default | Levels |
| orders | untyped | list(ar = 0, i = 1, ma = 1) | |
| lags | untyped | - | |
| constant | logical | FALSE | TRUE, FALSE |
| arma | untyped | NULL | |
| initial | character | backcasting | backcasting, optimal, two-stage, complete |
| loss | character | likelihood | likelihood, MSE, MAE, HAM, MSEh, TMSE, GTMSE, MSCE, GPL |
| holdout | logical | FALSE | TRUE, FALSE |
| bounds | character | admissible | admissible, usual, none |
| silent | logical | TRUE | TRUE, FALSE |
| regressors | character | use | use, select, adapt |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstSmooth -> LearnerFcstSsarima
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstSsarima$new()Creates a new instance of this R6 class.
LearnerFcstSsarima$new()
LearnerFcstSsarima$clone()The objects of this class are cloneable with this method.
LearnerFcstSsarima$clone(deep = FALSE)
deepWhether to make a deep clone.
Svetunkov I (2023). “Smooth forecasting with the smooth package in R.” 2301.01790, https://arxiv.org/abs/2301.01790.
Svetunkov I (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM), 1st edition. Chapman and Hall/CRC. doi:10.1201/9781003452652. https://openforecast.org/adam/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.ssarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.ssarima") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Forecasts of seasonal time series using STL decomposition. The seasonal component is forecast naively and the
seasonally-adjusted series is forecast with either an ETS or ARIMA model.
Calls forecast::stlm() from package forecast.
The task must provide a seasonal time series (frequency > 1).
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.stlm")
lrn("fcst.stlm")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| s.window | untyped | 7L + 4L * seq_len(6L) | - | |
| t.window | integer | NULL | |
|
| robust | logical | FALSE | TRUE, FALSE | - |
| method | character | ets | ets, arima | - |
| modelfunction | untyped | NULL | - | |
| etsmodel | untyped | "ZZN" | - | |
| lambda | untyped | NULL | - | |
| biasadj | logical | FALSE | TRUE, FALSE | - |
| allow.multiplicative.trend | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstStlm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstStlm$new()Creates a new instance of this R6 class.
LearnerFcstStlm$new()
LearnerFcstStlm$clone()The objects of this class are cloneable with this method.
LearnerFcstStlm$clone(deep = FALSE)
deepWhether to make a deep clone.
Cleveland RB, Cleveland WS, McRae JE, Terpenning I (1990). “STL: A Seasonal-Trend Decomposition Procedure Based on Loess.” Journal of Official Statistics, 6(1), 3–73.
Hyndman RJ, Athanasopoulos G (2018). Forecasting: principles and practice, 2nd edition. OTexts, Melbourne, Australia. https://OTexts.com/fpp2/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.stlm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.stlm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Structural time series model fit by maximum likelihood. Three model types are supported: local level, local linear
trend, and basic structural model (level + trend + seasonal).
Calls stats::StructTS() from package stats.
type = "BSM" requires a seasonal time series (frequency > 1). Prediction is performed via
forecast::forecast.StructTS() which yields point forecasts and predictive intervals from the Kalman filter.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.struct_ts")
lrn("fcst.struct_ts")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels |
| type | character | level | level, trend, BSM |
| init | untyped | NULL | |
| fixed | untyped | NULL | |
| optim.control | untyped | NULL | |
| lambda | untyped | NULL | |
| biasadj | logical | FALSE | TRUE, FALSE |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstStructTS
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstStructTS$new()Creates a new instance of this R6 class.
LearnerFcstStructTS$new()
LearnerFcstStructTS$clone()The objects of this class are cloneable with this method.
LearnerFcstStructTS$clone(deep = FALSE)
deepWhether to make a deep clone.
Harvey AC (1989). Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press, Cambridge.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.struct_ts") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.struct_ts") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Exponential smoothing state space model with Box-Cox transformation, ARMA errors, Trend and Seasonal components
(TBATS) model.
Calls forecast::tbats() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.tbats")
lrn("fcst.tbats")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”, “POSIXct”, “Date”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels | Range |
| use.box.cox | logical | NULL | TRUE, FALSE | - |
| use.trend | logical | NULL | TRUE, FALSE | - |
| use.damped.trend | logical | NULL | TRUE, FALSE | - |
| seasonal.periods | untyped | NULL | - | |
| use.arma.errors | logical | TRUE | TRUE, FALSE | - |
| use.parallel | logical | - | TRUE, FALSE | - |
| num.cores | integer | 2 | |
|
| bc.lower | numeric | 0 | |
|
| bc.upper | numeric | 1 | |
|
| biasadj | logical | FALSE | TRUE, FALSE | - |
| simulate | logical | FALSE | TRUE, FALSE | - |
| bootstrap | logical | FALSE | TRUE, FALSE | - |
| npaths | integer | 5000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstTbats
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstTbats$new()Creates a new instance of this R6 class.
LearnerFcstTbats$new()
LearnerFcstTbats$clone()The objects of this class are cloneable with this method.
LearnerFcstTbats$clone(deep = FALSE)
deepWhether to make a deep clone.
De Livera AM, Hyndman RJ, Snyder RD (2011). “Forecasting time series with complex seasonal patterns using exponential smoothing.” Journal of the American Statistical Association, 106(496), 1513–1527.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.tbats") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.tbats") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Theta model.
Calls forecast::theta_model() from package forecast.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.theta")
lrn("fcst.theta")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels |
| lambda | untyped | NULL | |
| biasadj | logical | FALSE | TRUE, FALSE |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstTheta
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstTheta$new()Creates a new instance of this R6 class.
LearnerFcstTheta$new()
LearnerFcstTheta$clone()The objects of this class are cloneable with this method.
LearnerFcstTheta$clone(deep = FALSE)
deepWhether to make a deep clone.
Assimakopoulos V, Nikolopoulos K (2000). “The theta model: a decomposition approach to forecasting.” International Journal of Forecasting, 16(4), 521–530.
Hyndman RJ, Billah B (2003). “Unmasking the Theta method.” International Journal of Forecasting, 19(2), 287–290.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.tscount,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.theta") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.theta") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized linear model for count time series (INGARCH).
Calls tscount::tsglm() from package tscount.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.tscount")
lrn("fcst.tscount")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, tscount
| Id | Type | Default | Levels | Range |
| past_obs | untyped | NULL | - | |
| past_mean | untyped | NULL | - | |
| external | untyped | FALSE | - | |
| link | character | identity | identity, log | - |
| distr | character | poisson | poisson, nbinom | - |
| B | integer | 1000 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstTscount
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstTscount$new()Creates a new instance of this R6 class.
LearnerFcstTscount$new()
LearnerFcstTscount$clone()The objects of this class are cloneable with this method.
LearnerFcstTscount$clone(deep = FALSE)
deepWhether to make a deep clone.
Liboschik T, Fokianos K, Fried R (2017). “tscount: An R Package for Analysis of Count Time Series Following Generalized Linear Models.” Journal of Statistical Software, 82(5), 1–51. doi:10.18637/jss.v082.i05.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tslm
# Define the Learner and set parameter values learner = lrn("fcst.tscount") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.tscount") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Time series linear model.
Calls forecast::tslm() from package forecast.
If formula is not set, the model is fit with the trend and season terms of forecast::tslm() plus all
features, i.e. <target> ~ trend + season + <features>.
This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():
mlr_learners$get("fcst.tslm")
lrn("fcst.tslm")
Task type: “fcst”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3forecast, forecast
| Id | Type | Default | Levels |
| formula | untyped | - | |
| lambda | untyped | NULL | |
| biasadj | logical | FALSE | TRUE, FALSE |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst -> LearnerFcstForecast -> LearnerFcstTslm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()LearnerFcstTslm$new()Creates a new instance of this R6 class.
LearnerFcstTslm$new()
LearnerFcstTslm$clone()The objects of this class are cloneable with this method.
LearnerFcstTslm$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Athanasopoulos G (2018). Forecasting: principles and practice, 2nd edition. OTexts, Melbourne, Australia. https://OTexts.com/fpp2/.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerFcst,
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.auto_gum,
mlr_learners_fcst.auto_msarima,
mlr_learners_fcst.auto_ssarima,
mlr_learners_fcst.bagged,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.croston,
mlr_learners_fcst.elm,
mlr_learners_fcst.es,
mlr_learners_fcst.ets,
mlr_learners_fcst.gum,
mlr_learners_fcst.holt_winters,
mlr_learners_fcst.mean,
mlr_learners_fcst.mlp,
mlr_learners_fcst.msarima,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.prophet,
mlr_learners_fcst.random_walk,
mlr_learners_fcst.rlgt,
mlr_learners_fcst.sma,
mlr_learners_fcst.spline,
mlr_learners_fcst.ssarima,
mlr_learners_fcst.stlm,
mlr_learners_fcst.struct_ts,
mlr_learners_fcst.tbats,
mlr_learners_fcst.theta,
mlr_learners_fcst.tscount
# Define the Learner and set parameter values learner = lrn("fcst.tslm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("fcst.tslm") print(learner) # Define a Task task = tsk("airpassengers") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # Print the model print(learner$model) # Importance method if ("importance" %in% learner$properties) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Measures the autocorrelation of the forecast residuals at lag 1. Values close to zero indicate that residuals are uncorrelated, while values far from zero suggest the model is not capturing all available information.
Computed as the sample autocorrelation of the residuals at lag 1 using stats::acf().
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.acf1")
msr("fcst.acf1")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: NA
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasureACF1
MeasureACF1$new()Creates a new instance of this R6 class.
MeasureACF1$new()
MeasureACF1$clone()The objects of this class are cloneable with this method.
MeasureACF1$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measures the proportion of true values that fall within the prediction interval.
A well-calibrated prediction interval at level should have coverage close to
.
where and are the lower and upper bounds of the prediction interval and
is the observed value.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.coverage")
msr("fcst.coverage")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: NA
Average: macro
Required Prediction: “quantiles”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| alpha | numeric | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureCoverage
MeasureCoverage$new()Creates a new instance of this R6 class.
MeasureCoverage$new()
MeasureCoverage$clone()The objects of this class are cloneable with this method.
MeasureCoverage$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measures the mean absolute error of the forecast scaled by the in-sample mean absolute error of the naive (or seasonal naive) forecast. Values less than one indicate the forecast is better than the naive baseline.
where is the training series, is the seasonal period, and is the length of the
training series.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.mase")
msr("fcst.mase")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| period | integer | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMASE
MeasureMASE$new()Creates a new instance of this R6 class.
MeasureMASE$new()
MeasureMASE$clone()The objects of this class are cloneable with this method.
MeasureMASE$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Koehler AB (2006). “Another look at measures of forecast accuracy.” International Journal of Forecasting, 22(4), 679–688.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measure of the proportion of correctly predicted directions between successive observations in forecast tasks.
where a is the reward for a correct direction (default 1), b is the penalty for an incorrect direction
(default 0), and n is the number of observations.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.mda")
msr("fcst.mda")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: FALSE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| reward | numeric | - | |
| penalty | numeric | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMDA
MeasureMDA$new()Creates a new instance of this R6 class.
MeasureMDA$new()
MeasureMDA$clone()The objects of this class are cloneable with this method.
MeasureMDA$clone(deep = FALSE)
deepWhether to make a deep clone.
Blaskowitz O, Herwartz H (2011). “On economic evaluation of directional forecasts.” International Journal of Forecasting, 27(4), 1058–1065.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measure of average percentage‐weighted directional accuracy in forecast tasks.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.mdpv")
msr("fcst.mdpv")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: FALSE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMDPV
MeasureMDPV$new()Creates a new instance of this R6 class.
MeasureMDPV$new()
MeasureMDPV$clone()The objects of this class are cloneable with this method.
MeasureMDPV$clone(deep = FALSE)
deepWhether to make a deep clone.
Blaskowitz O, Herwartz H (2011). “On economic evaluation of directional forecasts.” International Journal of Forecasting, 27(4), 1058–1065.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measure of average magnitude‐weighted directional accuracy in forecast tasks.
where n is the number of observations.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.mdv")
msr("fcst.mdv")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: FALSE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMDV
MeasureMDV$new()Creates a new instance of this R6 class.
MeasureMDV$new()
MeasureMDV$clone()The objects of this class are cloneable with this method.
MeasureMDV$clone(deep = FALSE)
deepWhether to make a deep clone.
Blaskowitz O, Herwartz H (2011). “On economic evaluation of directional forecasts.” International Journal of Forecasting, 27(4), 1058–1065.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measure of the average signed percentage error of forecasts. Positive values indicate systematic under-forecasting, negative values indicate over-forecasting.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.mpe")
msr("fcst.mpe")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: NA
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMPE
MeasureMPE$new()Creates a new instance of this R6 class.
MeasureMPE$new()
MeasureMPE$clone()The objects of this class are cloneable with this method.
MeasureMPE$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measures the quality of central prediction intervals, scaling the interval (Winkler) score by the in-sample mean absolute error of the naive (or seasonal naive) forecast. The interval score rewards narrow intervals and penalizes observations falling outside them, and the scaling makes the measure comparable across series of different magnitudes. This is the prediction-interval metric used in the M4 competition. Smaller scores indicate better calibrated and narrower intervals.
For a central interval at level 1 - alpha with lower and upper bounds and
(the alpha/2 and 1 - alpha/2 quantiles):
where is the training series, is the seasonal period, and is the length of
the training series. For keyed tasks the score is computed per series and averaged.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.msis")
msr("fcst.msis")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “quantiles”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| alpha | numeric | - | |
| period | integer | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureMSIS
MeasureMSIS$new()Creates a new instance of this R6 class.
MeasureMSIS$new()
MeasureMSIS$clone()The objects of this class are cloneable with this method.
MeasureMSIS$clone(deep = FALSE)
deepWhether to make a deep clone.
Gneiting T, Raftery AE (2007). “Strictly Proper Scoring Rules, Prediction, and Estimation.” Journal of the American Statistical Association, 102(477), 359–378.
Makridakis S, Spiliotis E, Assimakopoulos V (2020). “The M4 Competition: 100,000 time series and 61 forecasting methods.” International Journal of Forecasting, 36(1), 54–74.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measures the quality of quantile (probabilistic) forecasts using the pinball loss, also known as the quantile loss. The loss is averaged over all observations and all predicted quantile levels. Smaller scores indicate better calibrated quantile forecasts.
For a single quantile level with forecast and observation the pinball loss is
The reported score is twice the mean of over all observations and all quantile levels
, matching the convention used by fabletools so that the median ()
pinball loss equals the mean absolute error.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.pinball")
msr("fcst.pinball")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “quantiles”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasurePinball
MeasurePinball$new()Creates a new instance of this R6 class.
MeasurePinball$new()
MeasurePinball$clone()The objects of this class are cloneable with this method.
MeasurePinball$clone(deep = FALSE)
deepWhether to make a deep clone.
Koenker R, Bassett G (1978). “Regression Quantiles.” Econometrica, 46(1), 33–50.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measures the root mean squared error of the forecast scaled by the in-sample mean squared error of the naive (or seasonal naive) forecast. Values less than one indicate the forecast is better than the naive baseline.
where is the training series, is the seasonal period, and is the length of the
training series.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.rmsse")
msr("fcst.rmsse")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| period | integer | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureRMSSE
MeasureRMSSE$new()Creates a new instance of this R6 class.
MeasureRMSSE$new()
MeasureRMSSE$clone()The objects of this class are cloneable with this method.
MeasureRMSSE$clone(deep = FALSE)
deepWhether to make a deep clone.
Hyndman RJ, Koehler AB (2006). “Another look at measures of forecast accuracy.” International Journal of Forecasting, 22(4), 679–688.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.wape,
mlr_measures_fcst.winkler
Measure of the total absolute error of forecasts as a percentage of the total absolute truth. It weights each error by the magnitude of the series, making it robust to individual observations close to zero where the ordinary percentage error is undefined.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.wape")
msr("fcst.wape")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “response”
Required Packages: mlr3, mlr3forecast
Empty ParamSet
mlr3::Measure -> mlr3::MeasureRegr -> MeasureWAPE
MeasureWAPE$new()Creates a new instance of this R6 class.
MeasureWAPE$new()
MeasureWAPE$clone()The objects of this class are cloneable with this method.
MeasureWAPE$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.winkler
Measures the quality of prediction intervals by combining their width with a penalty for observations falling outside the interval. Smaller scores indicate better calibrated and narrower intervals.
where and are the lower and upper bounds of the prediction interval,
is the observed value, and is the significance level.
The Winkler score is then the mean of over all observations.
This mlr3::Measure can be instantiated via the dictionary mlr3::mlr_measures or with the associated sugar function mlr3::msr():
mlr_measures$get("fcst.winkler")
msr("fcst.winkler")
Forecast measures are registered with task_type = "regr" so they compose with the standard regression
measures (e.g. mlr3::mlr_measures_regr.rmse) on the PredictionFcst that forecast learners produce.
List them via the key prefix, not the task type, as the latter returns nothing:
as.data.table(mlr_measures)[grepl("^fcst", key)]
Task type: “regr”
Range:
Minimize: TRUE
Average: macro
Required Prediction: “quantiles”
Required Packages: mlr3, mlr3forecast
| Id | Type | Default | Range |
| alpha | numeric | - |
|
mlr3::Measure -> mlr3::MeasureRegr -> MeasureWinkler
MeasureWinkler$new()Creates a new instance of this R6 class.
MeasureWinkler$new()
MeasureWinkler$clone()The objects of this class are cloneable with this method.
MeasureWinkler$clone(deep = FALSE)
deepWhether to make a deep clone.
Winkler RL (1972). “A Decision-Theoretic Approach to Interval Estimation.” Journal of the American Statistical Association, 67(337), 187–191.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-eval
Package mlr3measures for the scoring functions.
as.data.table(mlr_measures) for a table of available Measures in the running session (depending on the loaded packages).
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
Other Measure:
mlr_measures_fcst.acf1,
mlr_measures_fcst.coverage,
mlr_measures_fcst.mase,
mlr_measures_fcst.mda,
mlr_measures_fcst.mdpv,
mlr_measures_fcst.mdv,
mlr_measures_fcst.mpe,
mlr_measures_fcst.msis,
mlr_measures_fcst.pinball,
mlr_measures_fcst.rmsse,
mlr_measures_fcst.wape
This PipeOp extracts the 22 (or 24) canonical time series characteristics (catch22) from the target variable.
For more details, see Rcatch22::catch22_all(), which is called internally on the ordered target vector.
For other time series feature extractors, see PipeOpFcstTsfeats and PipeOpFcstFeasts.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreproc, as well as:
catch24 :: logical(1)
If TRUE, additionally compute the mean and standard deviation (the catch24 set). Default FALSE.
The new columns are named {target}_catch22_{feature}. If the target was called "y" and the feature is
"DN_HistogramMode_5", the corresponding new column will be called "y_catch22_DN_HistogramMode_5".
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpFcstCatch22
PipeOpFcstCatch22$new()Initializes a new instance of this Class.
PipeOpFcstCatch22$new(id = "fcst.catch22", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.catch22".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstCatch22$clone()The objects of this class are cloneable with this method.
PipeOpFcstCatch22$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.catch22") out = po$train(list(task))[[1L]] out$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.catch22") out = po$train(list(task))[[1L]] out$head()
Computes per-series summary features from the target variable via fabletools::features() with feature
functions from the feasts package, and broadcasts them as constant columns to every row of the
corresponding series. For an unkeyed task the features are broadcast to every row. For a keyed task each key
contributes one feature vector.
This is the feasts (tidyverts) counterpart of PipeOpFcstTsfeats. Predicting on a key that was not seen during training is an error.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreproc, as well as:
features :: list()
A list of feasts feature functions (e.g. feasts::feat_acf, feasts::feat_stl) or a
fabletools::feature_set(). Default list(feasts::feat_acf, feasts::feat_stl).
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpFcstFeasts
PipeOpFcstFeasts$new()Initializes a new instance of this Class.
PipeOpFcstFeasts$new(id = "fcst.feasts", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.feasts".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstFeasts$clone()The objects of this class are cloneable with this method.
PipeOpFcstFeasts$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.feasts", features = list(feasts::feat_acf)) out = po$train(list(task))[[1L]] out$head() # select features by tag via fabletools::feature_set() (requires feasts to be attached so its # feature registry is populated) library(feasts) features = fabletools::feature_set(pkgs = "feasts", tags = "autocorrelation") po = po("fcst.feasts", features = features) po$train(list(task))[[1L]]$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.feasts", features = list(feasts::feat_acf)) out = po$train(list(task))[[1L]] out$head() # select features by tag via fabletools::feature_set() (requires feasts to be attached so its # feature registry is populated) library(feasts) features = fabletools::feature_set(pkgs = "feasts", tags = "autocorrelation") po = po("fcst.feasts", features = features) po$train(list(task))[[1L]]$head()
Creates pairs of Fourier (harmonic) terms sin(2 * pi * k * t / period) and cos(2 * pi * k * t / period) as new
feature columns, for k = 1, ..., K harmonics per seasonal period, where t is the per-series time position. They
encode seasonality as a flexible alternative to seasonal lags, in particular for long or non-integer periods and
multiple seasonalities at once.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreprocSimple, as well as the following parameters:
period :: numeric() | NULL
Seasonal period(s), in number of observations per cycle. May be non-integer and may contain multiple periods for
multiple seasonalities. If NULL (default), the period is derived from the task's frequency (task$freq).
K :: integer()
Number of Fourier harmonics per period. Either a single value recycled to all periods, or one value per period.
Each K must satisfy 2 * K <= period. Default 1L.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> mlr3pipelines::PipeOpTaskPreprocSimple -> PipeOpFcstFourier
PipeOpFcstFourier$new()Initializes a new instance of this Class.
PipeOpFcstFourier$new(id = "fcst.fourier", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.fourier".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstFourier$clone()The objects of this class are cloneable with this method.
PipeOpFcstFourier$clone(deep = FALSE)
deepWhether to make a deep clone.
De Livera AM, Hyndman RJ, Snyder RD (2011). “Forecasting time series with complex seasonal patterns using exponential smoothing.” Journal of the American Statistical Association, 106(496), 1513–1527.
Hyndman RJ, Khandakar Y (2008). “Automatic Time Series Forecasting: The forecast Package for R.” Journal of Statistical Software, 27(3), 1–22. doi:10.18637/jss.v027.i03.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.fourier", period = 12, K = 3L) new_task = po$train(list(task))[[1L]] new_task$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.fourier", period = 12, K = 3L) new_task = po$train(list(task))[[1L]] new_task$head()
Creates lagged versions of the target variable as new feature columns.
At train time the first rows of each series have no history for the requested lags. These
incomplete rows are dropped (the autoregressive-fit convention), so the base learner never sees
NA lags. A keyed series shorter than the largest lag is dropped entirely, with a warning.
At predict time lags are computed from the full series history.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreproc, as well as the following parameters:
lags :: integer()
The lags to create.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpFcstLags
PipeOpFcstLags$new()Initializes a new instance of this Class.
PipeOpFcstLags$new(id = "fcst.lags", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.lags".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstLags$clone()The objects of this class are cloneable with this method.
PipeOpFcstLags$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.lags", lags = 1:3) new_task = po$train(list(task))[[1L]] new_task$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.lags", lags = 1:3) new_task = po$train(list(task))[[1L]] new_task$head()
Creates rolling-window summary statistics of the target variable as new feature columns. The window ends at position
t - lag (exclusive of the current and lag - 1 most recent values) and has size window_size. Use window_size = Inf for an expanding window that grows to include all history up to t - lag.
At train time rows whose window has insufficient history are NA and are dropped, matching
PipeOpFcstLags. Predict keeps all rows.
At predict time rolling features are computed from the full series history.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreproc, as well as the following parameters:
funs :: character()
Aggregation functions. Subset of c("mean", "median", "sd", "min", "max", "sum"). Default "mean".
window_sizes :: numeric()
Window sizes. Every combination of funs and window_sizes produces one output column. Finite sizes must be
whole numbers. Inf requests an expanding window (all history up to t - lag). Default 3L.
lag :: integer(1)
Minimum lag before the window starts. Must be >= 1 to avoid leakage. Default 1L.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpFcstRolling
PipeOpFcstRolling$new()Initializes a new instance of this Class.
PipeOpFcstRolling$new(id = "fcst.rolling", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.rolling".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstRolling$clone()The objects of this class are cloneable with this method.
PipeOpFcstRolling$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.rolling", funs = c("mean", "sd"), window_sizes = c(3L, 12L)) new_task = po$train(list(task))[[1L]] new_task$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.rolling", funs = c("mean", "sd"), window_sizes = c(3L, 12L)) new_task = po$train(list(task))[[1L]] new_task$head()
Splits a keyed (multi-series) TaskFcst into a Multiplicity of
single-series tasks, one per key combination. Subsequent PipeOps are executed once per series
until a po("fcst.unitekey") is reached, fitting one local model
per series instead of one global model pooled across series.
The per-series tasks carry no key columns, so classical univariate learners (e.g.
lrn("fcst.ets")) compose as well. The key groups observed during training are stored in the
$state and the task must contain exactly the same key groups at predict time.
This PipeOp has no parameters.
mlr3pipelines::PipeOp -> PipeOpFcstSplitKey
PipeOpFcstSplitKey$new()Initializes a new instance of this Class.
PipeOpFcstSplitKey$new(id = "fcst.splitkey", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.splitkey".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstSplitKey$clone()The objects of this class are cloneable with this method.
PipeOpFcstSplitKey$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") graph = po("fcst.splitkey") %>>% lrn("fcst.ets") %>>% po("fcst.unitekey") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") graph = po("fcst.splitkey") %>>% lrn("fcst.ets") %>>% po("fcst.unitekey") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)
Applies a Box-Cox transformation to the target variable to stabilize the variance, producing the new target
BoxCox(y, lambda). The transformation is pointwise and monotonic, so no rows are dropped and predictions are
inverted via forecast::InvBoxCox(). lambda = 0 is the log transformation. When lambda is NULL (default) it
is estimated from the training data, per series on keyed tasks. Predicting a series not seen during training is an
error.
Box-Cox and log transformations require strictly positive target values. Non-positive values produce NaN or an
error. A negative estimated lambda can make forecast::InvBoxCox() return NA for upper quantiles. Set
lower = 0 to avoid this.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTargetTrafo, as well as the following:
lambda :: numeric(1) | NULL
Box-Cox transformation parameter. NULL (default) estimates it from the training data, 0 is the log
transformation, any other numeric is used as a fixed value.
method :: character(1)
Method used to estimate lambda when lambda = NULL, one of "guerrero" (default) or "loglik". See
forecast::BoxCox.lambda().
lower :: numeric(1)
Lower bound for the estimated lambda. Default -1.
upper :: numeric(1)
Upper bound for the estimated lambda. Default 2.
This PipeOp must not be placed inside a RecursiveForecaster or DirectForecaster graph and is rejected at
construction. Use it inside a plain mlr3pipelines::GraphLearner via ppl("targettrafo", ...), or wrap the
forecaster itself with ppl("targettrafo", ...) so all horizons are inverted together.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTargetTrafo -> PipeOpTargetTrafoBoxCox
PipeOpTargetTrafoBoxCox$new()Initializes a new instance of this Class.
PipeOpTargetTrafoBoxCox$new(id = "fcst.targetboxcox", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.targetboxcox".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpTargetTrafoBoxCox$clone()The objects of this class are cloneable with this method.
PipeOpTargetTrafoBoxCox$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) flrn = as_learner(ppl("targettrafo", graph = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)), trafo_pipeop = po("fcst.targetboxcox") )) flrn$train(task, split$train) flrn$predict(task, split$test)library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) flrn = as_learner(ppl("targettrafo", graph = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)), trafo_pipeop = po("fcst.targetboxcox") )) flrn$train(task, split$train) flrn$predict(task, split$test)
Differences the target variable with lag lag, producing the new target y'_t = y_t - y_{t - lag}. The first lag
rows are dropped during training and predictions are inverted back to the original scale. On keyed (multi-series)
tasks this happens within each series. Series too short for the requested lag are dropped with a warning, and
predicting a series not seen during training is an error.
Use lag = 1 to remove a trend and lag = 12 (or the seasonal period) to remove seasonality.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTargetTrafo, as well as the following:
lag :: integer(1)
Lag to difference at. Default 1L.
This PipeOp must not be placed inside a RecursiveForecaster or DirectForecaster graph and is rejected at
construction. Use it inside a plain mlr3pipelines::GraphLearner via ppl("targettrafo", ...), or wrap the
forecaster itself with ppl("targettrafo", ...) so all horizons are inverted together.
Quantile predictions cannot be inverted and are rejected.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTargetTrafo -> PipeOpTargetTrafoDifference
PipeOpTargetTrafoDifference$new()Initializes a new instance of this Class.
PipeOpTargetTrafoDifference$new(id = "fcst.targetdiff", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.targetdiff".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpTargetTrafoDifference$clone()The objects of this class are cloneable with this method.
PipeOpTargetTrafoDifference$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) flrn = as_learner(ppl("targettrafo", graph = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)), trafo_pipeop = po("fcst.targetdiff", lag = 1L) )) flrn$train(task, split$train) flrn$predict(task, split$test)library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) flrn = as_learner(ppl("targettrafo", graph = DirectForecaster$new(lrn("regr.rpart"), lags = 1:3, horizons = length(split$test)), trafo_pipeop = po("fcst.targetdiff", lag = 1L) )) flrn$train(task, split$train) flrn$predict(task, split$test)
Computes per-series summary features from the target variable via tsfeatures::tsfeatures() and broadcasts them
as constant columns to every row of the corresponding series. For an unkeyed task the features are broadcast to
every row. For a keyed task each key contributes one feature vector.
Predicting on a key that was not seen during training is an error.
The parameters are the parameters inherited from mlr3pipelines::PipeOpTaskPreproc, as well as:
features :: character()
Function names from the tsfeatures namespace that return numeric feature vectors. Default
c("frequency", "stl_features", "entropy", "acf_features").
scale :: logical(1)
If TRUE, scale each series to mean 0 and sd 1 before feature extraction. Default TRUE.
trim :: logical(1)
If TRUE, trim values outside ±trim_amount before feature extraction. Default FALSE.
trim_amount :: numeric(1)
Trimming threshold. Default 0.1.
parallel :: logical(1)
If TRUE, compute features in parallel via a future::plan(). Default FALSE.
multiprocess :: function
Function from the future package used when parallel = TRUE. Default future::multisession().
na.action :: function
Missing-value handler. Default stats::na.pass().
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpTaskPreproc -> PipeOpFcstTsfeats
PipeOpFcstTsfeats$new()Initializes a new instance of this Class.
PipeOpFcstTsfeats$new(id = "fcst.tsfeats", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.tsfeats".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstTsfeats$clone()The objects of this class are cloneable with this method.
PipeOpFcstTsfeats$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.tsfeats", features = c("entropy", "acf_features")) out = po$train(list(task))[[1L]] out$head()library(mlr3pipelines) task = tsk("airpassengers") po = po("fcst.tsfeats", features = c("entropy", "acf_features")) out = po$train(list(task))[[1L]] out$head()
Row-binds a Multiplicity of per-series PredictionFcsts, as
created downstream of po("fcst.splitkey"), into a single
PredictionFcst.
The series identity is rebuilt from the multiplicity names as a factor column in the
prediction's extra slot, so $key, as.data.table(), and autoplot.PredictionFcst() keep
working. Set key to the task's key column name to get predictions column-compatible with global
forecasters such as RecursiveForecaster, which attach the original key column.
key :: character(1)
Name of the rebuilt series-identity column in the prediction's extra slot. Default "key".
mlr3pipelines::PipeOp -> PipeOpFcstUniteKey
PipeOpFcstUniteKey$new()Initializes a new instance of this Class.
PipeOpFcstUniteKey$new(id = "fcst.unitekey", param_vals = list())
id(character(1))
Identifier of resulting object, default "fcst.unitekey".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would
otherwise be set during construction. Default list().
PipeOpFcstUniteKey$clone()The objects of this class are cloneable with this method.
PipeOpFcstUniteKey$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") graph = po("fcst.splitkey") %>>% lrn("fcst.ets") %>>% po("fcst.unitekey") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)library(mlr3pipelines) library(data.table) dt = CJ( month = seq(as.Date("2024-01-01"), by = "month", length.out = 36L), id = factor(c("a", "b")) ) dt[, value := rnorm(.N, mean = fifelse(id == "a", 10, 20))] task = as_task_fcst(dt, target = "value", order = "month", key = "id", freq = "month") graph = po("fcst.splitkey") %>>% lrn("fcst.ets") %>>% po("fcst.unitekey") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)
Performs (weighted) averaging of forecast PredictionFcsts, mirroring mlr3pipelines::PipeOpRegrAvg but
preserving the forecast prediction type, which plain regravg would drop. The output is a PredictionFcst that
keeps the time index and key columns (carried in the extra slot), so $order, $key,
autoplot.PredictionFcst(), and forecast task_type inference keep working through the ensemble.
Connect it to several PipeOpLearner outputs (classical forecast learners or RecursiveForecaster / DirectForecaster) to average their forecasts.
The parameters are the parameters inherited from mlr3pipelines::PipeOpRegrAvg.
mlr3pipelines::PipeOp -> mlr3pipelines::PipeOpEnsemble -> mlr3pipelines::PipeOpRegrAvg -> PipeOpFcstAvg
PipeOpFcstAvg$new()Initializes a new instance of this Class.
PipeOpFcstAvg$new( innum = 0L, collect_multiplicity = FALSE, id = "fcstavg", param_vals = list() )
innum(numeric(1))
Number of input channels. Default 0 creates a vararg channel taking an arbitrary number of inputs.
collect_multiplicity(logical(1))
If TRUE, the single input is a Multiplicity collecting channel. Requires
innum = 0. Default FALSE.
id(character(1))
Identifier of resulting object, default "fcstavg".
param_vals(named list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during
construction. Default list().
PipeOpFcstAvg$clone()The objects of this class are cloneable with this method.
PipeOpFcstAvg$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") graph = gunion(list( po("learner", lrn("fcst.auto_arima"), id = "arima"), po("learner", lrn("fcst.ets"), id = "ets") )) %>>% po("fcstavg") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)library(mlr3pipelines) task = tsk("airpassengers") graph = gunion(list( po("learner", lrn("fcst.auto_arima"), id = "arima"), po("learner", lrn("fcst.ets"), id = "ets") )) %>>% po("fcstavg") flrn = as_learner(graph)$train(task) forecast(flrn, task, 12L)
Splits data using a folds-folds (default: 5 folds) rolling window cross-validation.
This Resampling can be instantiated via the dictionary mlr_resamplings or with the associated sugar function rsmp():
mlr_resamplings$get("fcst.cv")
rsmp("fcst.cv")
horizon (integer(1))
Forecasting horizon in the test sets, i.e. number of test samples for each fold.
folds (integer(1))
Number of folds.
step_size (integer(1))
Step size between windows.
window_size (integer(1))
Size of the rolling window. For fixed_window = TRUE, this is the exact training window size. For fixed_window = FALSE (expanding window), this is the minimum number of training observations in the first fold.
fixed_window (logical(1))
Should a fixed sized window be used? If FALSE an expanding window is used.
mlr3::Resampling -> ResamplingFcstCV
iters(integer(1))
Returns the number of resampling iterations, depending on the values stored in the param_set.
ResamplingFcstCV$new()Creates a new instance of this R6 class.
ResamplingFcstCV$new()
ResamplingFcstCV$clone()The objects of this class are cloneable with this method.
ResamplingFcstCV$clone(deep = FALSE)
deepWhether to make a deep clone.
Tashman LJ (2000). “Out-of-sample tests of forecasting accuracy: an analysis and review.” International Journal of Forecasting, 16(4), 437–450.
Bergmeir C, Hyndman RJ, Koo B (2018). “A note on the validity of cross-validation for evaluating autoregressive time series prediction.” Computational Statistics & Data Analysis, 120, 70–83.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter3/evaluation_and_benchmarking.html#sec-resampling
Package mlr3spatiotempcv for spatio-temporal resamplings.
as.data.table(mlr_resamplings) for a table of available Resamplings in the running session (depending on the loaded packages).
mlr3spatiotempcv for additional mlr3::Resamplings for spatio-temporal tasks.
Other Resampling:
mlr_resamplings_fcst.holdout
# Create a task with 20 observations task = tsk("airpassengers") task$filter(1:20) # Instantiate Resampling cv = rsmp("fcst.cv", folds = 3, fixed_window = FALSE) cv$instantiate(task) # Individual sets: cv$train_set(1) cv$test_set(1) intersect(cv$train_set(1), cv$test_set(1)) # Internal storage: cv$instance # list# Create a task with 20 observations task = tsk("airpassengers") task$filter(1:20) # Instantiate Resampling cv = rsmp("fcst.cv", folds = 3, fixed_window = FALSE) cv$instantiate(task) # Individual sets: cv$train_set(1) cv$test_set(1) intersect(cv$train_set(1), cv$test_set(1)) # Internal storage: cv$instance # list
Splits data into a training set and a test set.
Parameter ratio determines the ratio of observation going into the training set.
This Resampling can be instantiated via the dictionary mlr_resamplings or with the associated sugar function rsmp():
mlr_resamplings$get("fcst.holdout")
rsmp("fcst.holdout")
ratio (numeric(1))
Ratio of observations to put into the training set.
Mutually exclusive with parameter n.
n (integer(1))
Number of observations to put into the training set.
If negative, the absolute value determines the number of observations in the test set.
Mutually exclusive with parameter ratio.
mlr3::Resampling -> ResamplingFcstHoldout
iters(integer(1))
Returns the number of resampling iterations, depending on the values stored in the param_set.
ResamplingFcstHoldout$new()Creates a new instance of this R6 class.
ResamplingFcstHoldout$new()
ResamplingFcstHoldout$clone()The objects of this class are cloneable with this method.
ResamplingFcstHoldout$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter3/evaluation_and_benchmarking.html#sec-resampling
Package mlr3spatiotempcv for spatio-temporal resamplings.
as.data.table(mlr_resamplings) for a table of available Resamplings in the running session (depending on the loaded packages).
mlr3spatiotempcv for additional mlr3::Resamplings for spatio-temporal tasks.
Other Resampling:
mlr_resamplings_fcst.cv
# Create a task with 10 observations task = tsk("airpassengers") task$filter(1:10) # Instantiate Resampling holdout = rsmp("fcst.holdout", ratio = 0.5) holdout$instantiate(task) # Individual sets: holdout$train_set(1) holdout$test_set(1) # Disjunct sets: intersect(holdout$train_set(1), holdout$test_set(1)) # Internal storage: holdout$instance # simple list# Create a task with 10 observations task = tsk("airpassengers") task$filter(1:10) # Instantiate Resampling holdout = rsmp("fcst.holdout", ratio = 0.5) holdout$instantiate(task) # Individual sets: holdout$train_set(1) holdout$test_set(1) # Disjunct sets: intersect(holdout$train_set(1), holdout$test_set(1)) # Internal storage: holdout$instance # simple list
A forecast task for the popular datasets::AirPassengers data set. The task represents the monthly totals of international airline passengers from 1949 to 1960.
R6::R6Class inheriting from TaskFcst.
This Task can be instantiated via the dictionary mlr_tasks or with the associated sugar function tsk():
mlr_tasks$get("airpassengers")
tsk("airpassengers")
Task type: “fcst”
Dimensions: 144x1
Properties: “ordered”
Has Missings: FALSE
Target: “passengers”
Features: -
Box GEP, Jenkins GM (1976). Time Series Analysis: Forecasting and Control, Revised edition. Holden-Day, San Francisco.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
TaskFcst,
mlr_tasks_electricity,
mlr_tasks_livestock,
mlr_tasks_lynx,
mlr_tasks_usaccdeaths
A forecast task for the tsibbledata::vic_elec data set.
The task represents a daily time series and is ordered by date.
R6::R6Class inheriting from TaskFcst.
This Task can be instantiated via the dictionary mlr_tasks or with the associated sugar function tsk():
mlr_tasks$get("electricity")
tsk("electricity")
Task type: “fcst”
Dimensions: 1096x3
Properties: “ordered”
Has Missings: FALSE
Target: “demand”
Features: “holiday”, “temperature”
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
TaskFcst,
mlr_tasks_airpassengers,
mlr_tasks_livestock,
mlr_tasks_lynx,
mlr_tasks_usaccdeaths
A forecast task for the tsibbledata::aus_livestock data set.
The task represents a monthly time series and is ordered by month.
R6::R6Class inheriting from TaskFcst.
This Task can be instantiated via the dictionary mlr_tasks or with the associated sugar function tsk():
mlr_tasks$get("livestock")
tsk("livestock")
Task type: “fcst”
Dimensions: 29364x3
Properties: “ordered”, “keys”
Has Missings: FALSE
Target: “count”
Features: “animal”, “state”
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
TaskFcst,
mlr_tasks_airpassengers,
mlr_tasks_electricity,
mlr_tasks_lynx,
mlr_tasks_usaccdeaths
A forecast task for the popular datasets::lynx data set. The task represents the annual numbers of lynx trappings in Canada from 1821 to 1934.
R6::R6Class inheriting from TaskFcst.
This Task can be instantiated via the dictionary mlr_tasks or with the associated sugar function tsk():
mlr_tasks$get("lynx")
tsk("lynx")
Task type: “fcst”
Dimensions: 114x1
Properties: “ordered”
Has Missings: FALSE
Target: “count”
Features: -
Brockwell PJ, Davis RA (1991). Time Series: Theory and Methods, 2nd edition. Springer, New York.
Campbell MJ, Walker AM (1977). “A Survey of Statistical Work on the Mackenzie River Series of Annual Canadian Lynx Trappings for the Years 1821-1934 and a New Analysis.” Journal of the Royal Statistical Society. Series A (General), 140(4), 411–431. doi:10.2307/2345277.
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
TaskFcst,
mlr_tasks_airpassengers,
mlr_tasks_electricity,
mlr_tasks_livestock,
mlr_tasks_usaccdeaths
A forecast task for the popular datasets::USAccDeaths data set. The task represents the monthly totals of accidental deaths in the US from 1973 to 1978.
R6::R6Class inheriting from TaskFcst.
This Task can be instantiated via the dictionary mlr_tasks or with the associated sugar function tsk():
mlr_tasks$get("usaccdeaths")
tsk("usaccdeaths")
Task type: “fcst”
Dimensions: 72x1
Properties: “ordered”
Has Missings: FALSE
Target: “deaths”
Features: -
Brockwell PJ, Davis RA (1991). Time Series: Theory and Methods, 2nd edition. Springer, New York.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
TaskFcst,
mlr_tasks_airpassengers,
mlr_tasks_electricity,
mlr_tasks_livestock,
mlr_tasks_lynx
Creates a split of the row ids of a Task into a training and a test set, and optionally a validation set.
## S3 method for class 'TaskFcst' partition(task, ratio = 0.67)## S3 method for class 'TaskFcst' partition(task, ratio = 0.67)
task |
(Task) |
ratio |
( |
task = tsk("airpassengers") split = partition(task, ratio = 0.8)task = tsk("airpassengers") split = partition(task, ratio = 0.8)
This object wraps the predictions returned by a forecast learner (LearnerFcst, RecursiveForecaster,
DirectForecaster). It subclasses mlr3::PredictionRegr, so forecasting is treated as regression: the
response, se, quantiles and distr fields and all regression measures continue to work.
In addition, the prediction carries the time index (and any key columns) of the forecast horizon in its
$data$extra slot. These are exposed via the $order and $key fields, lead the as.data.table() output,
and are used by autoplot.PredictionFcst() to draw a forecast plot.
The task_type is kept as "regr" so that regression measures remain compatible: forecasting is scored as
regression.
mlr3::Prediction -> mlr3::PredictionRegr -> PredictionFcst
order(data.table::data.table() | NULL)
The forecast time index, recovered from $data$extra. A table with two columns:
row_id (integer()), and
order (Date() | POSIXct() | integer() | numeric()).
Returns NULL if no extra data is stored.
key(data.table::data.table() | NULL)
The series identity columns of the forecast horizon, recovered from $data$extra. A table with two
or more columns:
row_id (integer()), and
key variable(s) (factor() | ordered()).
If there is only one key column, it is named key. Returns NULL if there are no key columns.
PredictionFcst$new()Creates a new instance of this R6 class.
PredictionFcst$new( task = NULL, row_ids = task$row_ids, truth = task$truth(), response = NULL, se = NULL, quantiles = NULL, distr = NULL, weights = NULL, check = TRUE, extra = NULL, raw = NULL )
task(TaskFcst)
Task, used to extract defaults for row_ids and truth.
row_ids(integer())
Row ids of the predicted observations, i.e. the row ids of the test set.
truth(numeric())
True (observed) response.
response(numeric())
Vector of numeric response values. One element for each observation in the test set.
se(numeric())
Numeric vector of predicted standard errors. One element for each observation in the test set.
quantiles(matrix())
Numeric matrix of predicted quantiles. One row per observation, one column per quantile.
distr(VectorDistribution)VectorDistribution from package distr6 (in repository https://raphaels1.r-universe.dev).
weights(numeric())
Vector of measure weights for each observation.
check(logical(1))
If TRUE, performs some argument checks and predict type conversions.
extra(list())
Named list carrying the order (time) column and any key columns of the forecast horizon. The list
names are the original task column names.
raw(any)
Raw prediction object from the upstream model. Stored as-is without validation.
PredictionFcst$clone()The objects of this class are cloneable with this method.
PredictionFcst$clone(deep = FALSE)
deepWhether to make a deep clone.
Package mlr3viz for some generic visualizations.
task = tsk("airpassengers") learner = lrn("fcst.auto_arima")$train(task) p = forecast(learner, task, h = 12) p$predict_types head(as.data.table(p))task = tsk("airpassengers") learner = lrn("fcst.auto_arima")$train(task) p = forecast(learner, task, h = 12) p$predict_types head(as.data.table(p))
Parses a file located at file and returns a data.table::data.table().
read_tsf(file)read_tsf(file)
file |
( |
(data.table::data.table()) with class "tsf". If the file contains a frequency or horizon, the
"frequency" and "horizon" attributes are set, respectively.
Godahewa R, Bergmeir C, Webb GI, Hyndman RJ, Montero-Manso P (2021). “Monash time series forecasting archive.” arXiv preprint arXiv:2105.06643.
file = system.file("extdata", "m3_yearly_dataset.tsf", package = "mlr3forecast") dt = read_tsf(file) head(dt)file = system.file("extdata", "m3_yearly_dataset.tsf", package = "mlr3forecast") dt = read_tsf(file) head(dt)
Function to create a RecursiveForecaster object. This is the recommended way to construct a recursive forecaster.
It is a thin wrapper around RecursiveForecaster$new().
A recursive forecaster trains a single regression model and forecasts iteratively one step ahead, feeding each
prediction back as a lag/rolling feature for the next step. For the direct strategy (one model per horizon) see
direct_forecaster().
recursive_forecaster( learner, lags = NULL, id = NULL, param_vals = list(), predict_type = NULL, clone_graph = TRUE )recursive_forecaster( learner, lags = NULL, id = NULL, param_vals = list(), predict_type = NULL, clone_graph = TRUE )
learner |
(mlr3::Learner | mlr3pipelines::Graph | mlr3pipelines::PipeOp) |
lags |
( |
id |
( |
param_vals |
(named |
predict_type |
( |
clone_graph |
( |
library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # simple: wrap a regression learner with lag features flrn = recursive_forecaster(lrn("regr.rpart"), lags = 1:3) flrn$train(task, split$train) flrn$predict(task, split$test) # graph: custom preprocessing pipeline graph = po("fcst.lags", lags = 1:3) %>>% lrn("regr.rpart") flrn = recursive_forecaster(graph)library(mlr3pipelines) task = tsk("airpassengers") split = partition(task, ratio = 0.8) # simple: wrap a regression learner with lag features flrn = recursive_forecaster(lrn("regr.rpart"), lags = 1:3) flrn$train(task, split$train) flrn$predict(task, split$test) # graph: custom preprocessing pipeline graph = po("fcst.lags", lags = 1:3) %>>% lrn("regr.rpart") flrn = recursive_forecaster(graph)
A mlr3::Learner for iterative one-step-ahead forecasting: a single model is fit, then applied recursively, feeding each prediction back as a lag/rolling feature for the next step.
Can be constructed in two ways:
Simple: RecursiveForecaster$new(learner, lags = 1:3) – internally builds
po("fcst.lags", lags = lags) %>>% learner.
Graph: RecursiveForecaster$new(graph) – takes an arbitrary
mlr3pipelines::Graph or mlr3pipelines::PipeOp.
A target transformation (e.g. mlr_pipeops_fcst.targetdiff, mlr3pipelines::PipeOpTargetMutate)
must wrap the forecaster, not be placed inside its graph. Wrap it with
mlr3pipelines::ppl("targettrafo") so the whole series is transformed once up front, the
recursion runs entirely on the transformed scale, and predictions are inverted once at the end:
flrn = as_learner(ppl("targettrafo",
graph = RecursiveForecaster$new(lrn("regr.rpart"), lags = 1:12),
trafo_pipeop = po("fcst.targetdiff", lag = 1L)
))
flrn$train(task, split$train)
flrn$predict(task, split$test) # predictions are on the original scale
Placing a mlr3pipelines::PipeOpTargetTrafo inside the graph is not supported and is rejected at construction.
Only the point forecast is fed back between steps, so se/distr uncertainty does not accumulate across horizons
and intervals are too narrow for h > 1. For calibrated multi-step intervals, prefer DirectForecaster.
mlr3::Learner -> RecursiveForecaster
learner(mlr3::Learner)
The base regression learner.
native_model(any)
The fitted model.
lags(integer() | NULL)
The lags used, or NULL if no PipeOpFcstLags is in the graph.
param_set(paradox::ParamSet)
Set of hyperparameters.
marshaled(logical(1))
Whether the learner's model is currently in marshaled form.
predict_type(character(1))
Stores the currently active predict type.
RecursiveForecaster$new()Creates a new instance of this R6 class.
RecursiveForecaster$new( learner, lags = NULL, id = NULL, param_vals = list(), predict_type = NULL, clone_graph = TRUE )
learner(mlr3::Learner | mlr3pipelines::Graph | mlr3pipelines::PipeOp)
A regression learner (when lags is provided) or a graph/PipeOp.
lags(integer() | NULL)
The lag values to use for creating lag features. If provided, learner is wrapped with
po("fcst.lags", lags = lags). If NULL, learner must be a mlr3pipelines::Graph or
mlr3pipelines::PipeOp.
id(character(1) | NULL)
Identifier, default NULL (auto-generated).
param_vals(named list())
List of hyperparameter settings.
predict_type(character(1) | NULL)
The predict type, default NULL.
clone_graph(logical(1))
Whether to clone the graph, default TRUE.
RecursiveForecaster$print()Printer.
RecursiveForecaster$print(...)
...(ignored).
RecursiveForecaster$marshal()Marshal the learner's model.
RecursiveForecaster$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
RecursiveForecaster$unmarshal()Unmarshal the learner's model.
RecursiveForecaster$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
RecursiveForecaster$clone()The objects of this class are cloneable with this method.
RecursiveForecaster$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3pipelines) task = tsk("airpassengers") flrn = RecursiveForecaster$new(lrn("regr.rpart"), lags = 1:3) split = partition(task, ratio = 0.8) flrn$train(task, split$train) flrn$predict(task, split$test) # graph: custom preprocessing pipeline graph = po("fcst.lags", lags = 1:3) %>>% lrn("regr.rpart") flrn = RecursiveForecaster$new(graph) flrn$train(task, split$train) flrn$predict(task, split$test)library(mlr3pipelines) task = tsk("airpassengers") flrn = RecursiveForecaster$new(lrn("regr.rpart"), lags = 1:3) split = partition(task, ratio = 0.8) flrn$train(task, split$train) flrn$predict(task, split$test) # graph: custom preprocessing pipeline graph = po("fcst.lags", lags = 1:3) %>>% lrn("regr.rpart") flrn = RecursiveForecaster$new(graph) flrn$train(task, split$train) flrn$predict(task, split$test)
mlr3pipelines::Selector that selects lag features created by PipeOpFcstLags.
Matches features named {target}_lag_{i} where {target} is the task's target variable.
selector_fcst_lags()selector_fcst_lags()
function: A mlr3pipelines::Selector function.
Other Selectors:
selector_fcst_rolling()
library(mlr3pipelines) task = tsk("airpassengers") pop = po("fcst.lags", lags = 1:3) new_task = pop$train(list(task))[[1L]] selector_fcst_lags()(new_task)library(mlr3pipelines) task = tsk("airpassengers") pop = po("fcst.lags", lags = 1:3) new_task = pop$train(list(task))[[1L]] selector_fcst_lags()(new_task)
mlr3pipelines::Selector that selects rolling-window features created by PipeOpFcstRolling.
Matches features named {target}_roll_{fun}_{size} where {target} is the task's target variable
and {fun} is one of the aggregation functions supported by PipeOpFcstRolling.
selector_fcst_rolling()selector_fcst_rolling()
function: A mlr3pipelines::Selector function.
Other Selectors:
selector_fcst_lags()
library(mlr3pipelines) task = tsk("airpassengers") pop = po("fcst.rolling", funs = c("mean", "sd"), window_sizes = c(3L, 12L)) new_task = pop$train(list(task))[[1L]] selector_fcst_rolling()(new_task)library(mlr3pipelines) task = tsk("airpassengers") pop = po("fcst.rolling", funs = c("mean", "sd"), window_sizes = c(3L, 12L)) new_task = pop$train(list(task))[[1L]] selector_fcst_rolling()(new_task)
This task specializes mlr3::Task, mlr3::TaskSupervised and mlr3::TaskRegr for forecasting problems. The target
column is assumed to be numeric. The task_type is set to "fcst".
It is recommended to use as_task_fcst() for construction.
Predefined tasks are stored in the dictionary mlr3::mlr_tasks.
A task may have one or more key columns whose combination identifies each series. The key role drives all
per-series operations: target lags and rolling windows (PipeOpFcstLags, PipeOpFcstRolling) are computed within
each series, and the future forecast grid is built per series.
Key columns are also features by default, which lets a global model specialize per series. Drop a key's feature role while keeping the grouping when it carries no signal beyond identifying the series:
task$set_col_roles("series_id", remove_from = "feature")
For a high-cardinality key, encode it inside the learner graph (e.g. po("encodeimpact") or po("encodelmer"))
rather than passing the raw factor to the model.
mlr3::Task -> mlr3::TaskSupervised -> mlr3::TaskRegr -> TaskFcst
freq(character(1) | numeric(1) | NULL)
The frequency of the time series.
properties(character())
Set of task properties.
Possible properties are stored in mlr_reflections$task_properties.
The following properties are currently standardized and understood by tasks in mlr3:
"strata": The task is resampled using one or more stratification variables (role "stratum").
"groups": The task comes with grouping/blocking information (role "group").
"weights_learner": The task comes with observation weights for the learner (role "weights_learner").
"weights_measure": The task comes with observation weights for the measure (role "weights_measure").
"offset": The task comes with offset information (role "offset").
"ordered": The task has columns which define the row order (role "order").
"keys": The task has columns which define the time series "key".
Note that above listed properties are calculated from the $col_roles and may not be set explicitly.
order(data.table::data.table())
A table with two columns:
row_id (integer()), and
order (Date() | POSIXct() | integer() | numeric()).
key(data.table::data.table() | NULL)
If the task has a column with designated role "key", a table with two or more columns:
row_id (integer()), and
key variable(s) (factor() | ordered()).
If there is only one key column, it will be named as key.
Returns NULL if there are no key columns.
mlr3::Task$add_strata()mlr3::Task$cbind()mlr3::Task$data()mlr3::Task$droplevels()mlr3::Task$filter()mlr3::Task$format()mlr3::Task$formula()mlr3::Task$head()mlr3::Task$help()mlr3::Task$levels()mlr3::Task$materialize_view()mlr3::Task$missings()mlr3::Task$rbind()mlr3::Task$rename()mlr3::Task$select()mlr3::Task$set_col_roles()mlr3::Task$set_levels()mlr3::Task$set_row_roles()mlr3::TaskRegr$truth()TaskFcst$new()Creates a new instance of this R6 class.
The function as_task_fcst() provides an alternative way to construct forecast tasks.
TaskFcst$new( id, backend, target, order, key = character(), freq = NULL, label = NA_character_, extra_args = list() )
id(character(1))
Identifier for the new instance.
backend(mlr3::DataBackend)
Either a mlr3::DataBackend, or any object which is convertible to a mlr3::DataBackend with as_data_backend().
E.g., a data.frame() will be converted to a mlr3::DataBackendDataTable.
target(character(1))
Name of the target column.
order(character(1))
Name of the order column.
key(character())
Name of the key column.
freq(character(1) | numeric(1) | NULL)
Frequency of the time series.
Either a positive number or a seq()-compatible string, e.g.:
"1 month", "day", "3 months", "1 hour", "week".
label(character(1))
Label for the new instance.
extra_args(named list())
Named list of constructor arguments, required for converting task types
via mlr3::convert_task().
TaskFcst$view()Returns a slice of the data from the mlr3::DataBackend as a data.table::data.table().
Rows default to observations with role "use", and columns default to features with roles
"target", "order", "key" or "feature". If rows or cols are specified which do not
exist in the mlr3::DataBackend, an exception is raised.
Rows and columns are returned in the order specified via the arguments rows and cols.
If rows is NULL, rows are returned in the order of task$row_ids.
If cols is NULL, the column order defaults to c(task$target_names, task$feature_names, task$col_roles$key, task$col_roles$order).
Note that it is recommended to not rely on the order of columns, and instead always
address columns with their respective column name.
TaskFcst$view(rows = NULL, cols = NULL, ordered = FALSE)
rows(positive integer() | NULL)
Vector or row indices.
cols(character() | NULL)
Vector of column names.
ordered(logical(1))
If TRUE, data is ordered according to the columns with column role "order" and "key".
TaskFcst$print()Printer.
TaskFcst$print(...)
...(ignored).
TaskFcst$clone()The objects of this class are cloneable with this method.
TaskFcst$clone(deep = FALSE)
deepWhether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html
Package mlr3data for more toy tasks.
Package mlr3oml for downloading tasks from https://www.openml.org.
Package mlr3viz for some generic visualizations.
as.data.table(mlr_tasks) for a table of available Tasks in the running session (depending on the loaded packages).
mlr3fselect and mlr3filters for feature selection and feature filtering.
Extension packages for additional task types:
Unsupervised clustering: mlr3cluster
Probabilistic supervised regression and survival analysis: https://mlr3proba.mlr-org.com/.
Other Task:
mlr_tasks_airpassengers,
mlr_tasks_electricity,
mlr_tasks_livestock,
mlr_tasks_lynx,
mlr_tasks_usaccdeaths
library(data.table) airpassengers = tsbox::ts_dt(AirPassengers) setnames(airpassengers, c("month", "passengers")) task = as_task_fcst(airpassengers, target = "passengers", order = "month", freq = "month") task$task_type task$formula() task$truth()library(data.table) airpassengers = tsbox::ts_dt(AirPassengers) setnames(airpassengers, c("month", "passengers")) task = as_task_fcst(airpassengers, target = "passengers", order = "month", freq = "month") task$task_type task$formula() task$truth()